
279 A.2d 450 (1971)
Joseph LOPES
v.
B. Cowles MALLORY, City Manager of the City of Newport et al.
No. 1130-Appeal.
Supreme Court of Rhode Island.
July 8, 1971.
*451 Ralph D. Morrison, Donato Andre D'Andrea, Newport, for plaintiff.
Joseph M. Hall, Asst. City Sol., Newport, for defendant.

OPINION
PAOLINO, Justice.
On May 5, 1965, Joseph Lopes, a retired Newport police officer, brought an action in the Superior Court of Newport County, for a declaratory judgment seeking to establish his rights to an increase in his retirement benefits.
The proceedings raised no substantial question of fact, and the sole issues before the court related to the interpretation of certain state enabling statutes[1] and applicability of the city ordinance[2] authorizing an increase in retirement payments. A hearing was held at the conclusion of which the court found that plaintiff's status as retired after 10 years of employment because of a service-connected disability was beneficially equal to the status of those who have retired after 25 years of service, and that, therefore, the plaintiff was entitled to the increase in the benefits.
Final judgment was entered in accordance with the court's findings, and no appeal was taken by the city. In order to compel payment of the larger pension sum, the plaintiff successfully prosecuted a mandamus action, and Officer Lopes began receiving full pension payments in accord with the previous decision. However, in April 1970, the City of Newport reverted to the lower pension benefits schedule.
*452 As a result of this action, plaintiff again filed a petition for a writ of mandamus to compel the City of Newport to pay him pension benefits as directed by the prior decisions. The defendants' answer raised no issue of fact, but attempted to justify the reduction in payments based on our decision in Beebe v. Fitzgerald, 106 R.I. 650, 262 A.2d 625, decided March 3, 1970. In the Beebe case, this court was faced with the exact issue as was raised in the original Lopes action in the Newport Superior Court. However, we held in Beebe that the city was not required to treat 25-year veterans and officers forced by injury to submit to an early retirement alike.
The plaintiff, Joseph Lopes, then moved for summary judgment, on the ground that the issue tendered by defendants had theretofore been adjudicated, so that it was res judicata. Relying on the Beebe decision, defendants filed a cross motion for summary judgment.
A hearing was held on both motions for summary judgment, and the court entered an order denying plaintiff's motion, but granting defendants' cross motion. The case is before us on plaintiff's appeal from this order.
The issue before us today is whether an unappealed declaratory judgment declaring the rights and legal relations of the parties to a pension agreement is effective and binding on the parties, in light of a subsequent decision by an appellate court, involving other parties, and which in effect decided that the prior declaratory judgment was an error of law.
The unappealed declaratory judgment in this case stands as a final judgment, rendered on the merits, without fraud or collusion, by a court of competent jurisdiction. This judgment is conclusive of rights, questions, and facts in issue, as to the parties and their privies in all other judicial tribunals of concurrent jurisdiction. 46 Am.Jur.2d, Judgments, § 394 (1969). Actions for declaratory judgments come within this principle:
"Where an action is brought to obtain a declaration of the rights or other legal relations of the parties to the action, whether or not further relief is or could be prayed, a final and valid judgment declaring such rights or other relations is binding between the parties in subsequent actions." Restatement, Judgments, § 77 (1942).
See also Developments in the Law, Res Judicata, 65 Harv. L. Rev. 818, 881 (1952), Annot. 10 A.L.R.2d 782, and cases cited therein.
The defendants argue that they are precluded from paying plaintiff the larger pension sum since in light of our decision in Beebe, supra, the prior determination was erroneous in law. However, for an issue to be res judicata, it is not necessary that the prior judgment be right. A judgment may be erroneous in law, but if it becomes final it is still binding and conclusive as between the parties upon the question. Reed v. Allen, 286 U.S. 191, 52 S.Ct. 532, 76 L.Ed. 1054; Ballard v. First Nat'l Bank, 259 F.2d 681 (5th Cir.1958); Paull v. Archer-Daniels-Midland Co., 313 F.2d 612 (8th Cir.1963); Goldsmith v. M. Jackman & Sons, 327 F.2d 184 (10th Cir.1964). As the court in the Ballard case said:
"`The doctrine of res judicata does not depend upon whether or not the prior judgment was right. It rests upon the finality of judgments as a matter of public policy, to the end that controversies once decided shall remain in repose.'" 259 F.2d at 683-684.
The defendants also argue that plaintiff's pension rights should be characterized as a contractual obligation requiring present and future performance without res judicata effect. However, the question of law essential to the prior declaratory judgment, that is, a declaration of plaintiff's pension rights, once litigated and determined by a final judgment, is conclusive between the parties in any subsequent *453 action, since both actions arose out of the same subject matter or transaction.[3]
Compare the 1924 case of United States v. Moser, 266 U.S. 236, 45 S.Ct. 66, 69 L.Ed. 262, where the United States Supreme Court held that an initial determination of a naval officer's rights to pay was res judicata in a subsequent suit for later pay installments, even though another suit by a different claimant proved that the prior decision was an error of law. Mr. Justice Sutherland, speaking for the Court, said:
"* * * a fact, question or right distinctly adjudged in the original action cannot be disputed in a subsequent action, even though the determination was reached upon an erroneous view or by an erroneous application of the law. That would be to affirm the principle in respect of the thing adjudged but, at the same time, deny it all efficacy by sustaining a challenge to the grounds upon which the judgment was based. (cites omitted) A determination in respect of the status of an individual upon which his right to recover depends is as conclusive as a decision upon any other matter." Id. at 242, 45 S.Ct. at 67, 69 L.Ed. at 264. (Emphasis supplied.)
It must be emphasized that in the instant case, the defendants could have, by timely appeal, taken measures to correct the application of law by the Superior Court justice, which it now seeks to do by application of a later case. The city could have and should have taken an appeal from the declaratory judgment if it thought it was wronged. Failing to have done so, it is now estopped under the doctrine of res judicata from attacking a judgment of a court of competent jurisdiction in a prior suit between the same parties, where that judgment was never reversed.
The plaintiff's appeal is sustained, the judgment appealed from is reversed, and the case is remitted to the Superior Court for further proceedings.
NOTES
[1]  Public Laws 1947, chap. 1896, in pertinent part, reads as follows:

"`The Newport police department pension and retirement system'"
* * * * *
"Sec. 11. a) The mayor and board of aldermen shall place on the inactive roll and retirement list any member of the Newport police department who was a member of said department the first day of January, A.D. 1947 and who has completed twenty-five years of active service in the department, provided a written request to that effect has been made by said member.
* * * * *
"Sec. 13. Any member of the Newport police department who shall be placed on the inactive roll and retirement list under any of the provisions of section 11 above, shall receive an annual pension and retirement allowance for the remainder of his life at the following rates depending on the grade or rank which the member has held for at least two years prior to his retirement:
"a) A patrolman shall receive twelve hundred ($1200.) dollars a year;
* * * * *
"Sec. 15. Any member of the Newport police department who becomes permanently disabled before the time he would otherwise be eligible for retirement, from any cause incurred or originating in the performance of duty, shall be entitled to an annual pension and retirement allowance at the rates provided in section 13."
[2]  On December 23, 1964, the Newport City Council enacted an ordinance numbered 413, chap. 151, which had for its expressed purpose the providing of "* * * benefits to the members of the Newport Police Department in addition to those provided in Chapter 1896 of the Public Laws of Rhode Island (1947) as amended * * *." The ordinance provided for an increase of $250 to the annual pension paid any person who had retired under the 25-year provision of the statute.
[3]  See Restatement Judgments, § 70 (1942). Questions of Law, comment (b), which, in pertinent part, reads as follows:

"b. Where causes of action arise out of the same subject matter or transaction. Where a question of law is actually litigated and determined in an action, the determination is ordinarily conclusive between the parties in a subsequent action involving the same subject matter or transaction, although based upon a different cause of action from that upon which the original action was based.
* * * * *
"Thus, if a retired government employee brings an action to recover from the government an amount claimed by him as due under a statute providing for pensions for retired government employees, and the government defends on the ground that the plaintiff's employment was not of a type included within the statute, and judgment is given for the plaintiff, the government is precluded in a subsequent action brought to recover a later installment of the pension from contending that the plaintiff's employment was not of a type included in the statute, even though in an action between different parties it had been held by the highest court that the employment was not of a type included within the statute." (Emphasis supplied.)
