pro tem.* — Lou B. Rowland,† the assignee of the interests of C. E. Burton and his wife in a parcel of real property, brought a suit in the Superior Court of Yolo County entitled 11 Complaint to Compel Redemption and to Quiet Title.” Named as defendants were Harvey 0. Barthel and his wife and the Bank of Davis. This appeal is from a judgment entered upon an order sustaining a general demurrer to the complaint without leave to amend.
Plaintiff alleged that in an action “involving title” to the same property here concerned, the land by a prior judgment against the Burtons in the same court was ordered to be sold “as the property of the plaintiff’s said assignors in the manner provided by law for sales pursuant to execution upon real property. ’ ’ The effect of that judgment, it was alleged, was to create - in the Burtons, as an equitable interest, “a right to redeem said real property according to law. ’ ’ The complaint includes the official record of the judgment, but its terms are pleaded by a statement of their legal effect.
Pursuant to the judgment, it was alleged, the property was sold by the sheriff to the Barthels, who were purchasers at the “execution sale.” It was further alleged that prior to the expiration of the period provided by law for the redemption of real property sold upon execution, the sheriff wrongfully delivered a deed to the property to the Barthels, who recorded it; that also of record is a deed of trust to secure a note payable to the Bank of Davis, which claims an interest in the property.
The prayer was for (1) a declaration of Rowland’s right to redeem the property; (2) an accounting by the Barthels; (3) an order directing the Barthels to reconvey the property; and the court was also asked to retain jurisdiction of the matter pending a redemption, and to quiet Rowland’s title against each of the defendants.
The defendants demurred to the complaint asserting, among other grounds, that it does not state facts sufficient to constitute a cause of action. In their memorandum of points and authorities accompanying the demurrer, defendants relied in part upon the terms of the judgment in the prior action. The trial judge considered the prior judgment which “terminated and foreclosed the interest of the plaintiff’s assignors in said *837real property and enjoined and restrained them forever from asserting any right, title and interest therein,” and held that it was impossible for Rowland to state a cause of action which would enable him to redeem the real property in controversy.
Two contentions are made by Rowland for the reversal of the judgment: (1) That it was prejudicial error for the trial court to consider the prior judgment; (2)- that even if such consideration were proper, the record in the former action may not be construed so as to deprive him of the right to redeem the property. Both of these contentions are devoid of merit.
The following rules are applicable to the first contention:
1. A demurrer reaches only to the contents of the pleading and such matters as may be considered under the doctrine of judicial notice. (County of Los Angeles v. Security First Nat. Bank, 84 Cal.App.2d 575, 579 [4] [191 P.2d 78].)
2. When a former judgment is properly pleaded in a complaint, such judgment may be considered by the trial court in determining whether it is res judicata of a plaintiff’s alleged cause of action. (Cf. Rideaux v. Torgrimson, 12 Cal.2d 633, 638 [8] [86 P.2d 826] ; Spitzer v. Superior Court, 74 Cal.App. 494,498 [1] [241 P.270].)
Applying the foregoing rules to the facts of the instant case, the judgment relied upon by defendants in bar of the cause of action alleged in the complaint was pleaded and identified in the complaint. Therefore, the trial court properly considered the contents of the judgment in ruling upon the demurrer. Since the judgment was pleaded it is unnecessary to consider whether the doctrine of judicial notice is here applicable. We do not decide such question.
As to the second contention, it is the general rule that a final judgment is res judicata of the issues involved therein where the trial court had jurisdiction. (Pacific Mutual Life Ins. Co. v. McConnell, 44 Cal.2d 715, 725 [10] [285 P.2d 636] ; San Diego Trust & Sav. Bank v. Young, 19 Cal.2d 98, 100 [1] [119 P.2d 133].)
In the present case the record discloses that the Barthels formerly were owners of a tract of unimproved land. In 1948, they entered into an oral contract, which was superseded by a later oral agreement, to sell the land and an abandoned streetcar on the premises to the Burtons. If the consideration was not paid in cash, the Barthels were to receive a note secured by a purchase money trust deed. The Burtons *838took possession of the property and began constructing improvements but, although demands were made upon them, they refused to pay the purchase price or to execute a note. In October of that year, a third oral agreement was made, the Burtons agreeing to pay immediately $5,000 for the land and to perform certain other obligations which were incident to the original agreements.
The Burtons continued in possession of the property for more than a year and one-half without paying the agreed purchase price. During that time, they continued to make improvements on the property for which they incurred mechanics’ liens and claims of materialmen in the sum of about $5,700. Despite repeated demands and a tender of a deed to the property by the Barthels, the purchase price remained unpaid. The Burtons resided in one of the buildings on the property without paying rent, and the Barthels were deprived of the crops from several walnut trees during the period of occupancy.
Finally, the Barthels brought suit against the Burtons. Their complaint was in two counts. In the first one, they alleged the execution of the oral agreements, the defendants’ breach, their unlawful holding of possession of the premises, and losses assertedly resulting therefrom. The second count pleaded that the Barthels were the owners of the property in question and that the Burtons claimed a right in it adverse to them. The prayer was for a cancellation of the oral agreement and a decree adjudging the defendants to be without interest in the property and enjoining them from asserting any claim to it. It was also prayed that the sheriff be commanded to put them into possession of the realty and to evict the Burtons. They also sought damages.
The trial court found that the Burtons had breached their oral agreement and that “Plaintiffs are the owners of said property, and Defendants, and anyone acting through them, have no right, title, or interest therein. The Plaintiffs have owned said real property at all times herein mentioned, subject only to said oral agreements. ’ ’ The Burtons had erected substantial improvements on the property of an uncertain value, and the court found that liens had accrued against the realty for mechanics’ services and materialmen’s claims; that the Burtons were in unlawful possession of the premises, and that the Barthels had been damaged by loss of use of the property and loss of the walnut crops.
It was adjudged: (1) that the interest of the Burtons, and of any person claiming through them, in the real property or *839the' oral contract “is hereby terminated and foreclosed”; (2) that the Burtons and such other persons were enjoined from aserting 1 ‘ any right, title or interest in and to said contract or said real property, which arose before the date of this Decree”; (3) that the Barthels were the owners of the real property in fee simple subject to its sale by order of the court “in the manner provided by law for sale pursuant to execution upon real property”; (4) that title was to be quieted in the purchaser from all claims by either the Barthels or the Burtons, or persons acting through them; (5) that they were enjoined from asserting any claim or demand arising prior to the date of the decree and (6) that “all equity of redemption of any of the aforesaid persons is hereby foreclosed.”
No appeal was taken from the decree and it became final. Pursuant to the decree, the property was sold at public auction to the Barthels and the proceeds from the sale distributed as ordered by the court.
From the foregoing facts it is apparent that the very issue which is presented in the instant case was before the trial court in the prior action, and that it gave a judgment contrary to the present contentions of the plaintiff, which expressly foreclosed “all equity of redemption of any of the aforesaid persons,” which includes the plaintiff. Since it appears that in the prior action the trial court had jurisdiction of the subject matter and of the parties thereto, and the judgment in such action has become final, it may not now be attacked by plaintiff on the ground that it was incorrect. In Panos v. Great Western Packing Co. this court, speaking through Mr. Chief Justice Gibson, succinctly stated the applicable rule thus: “An erroneous judgment is as conclusive as a correct one.” (21 Cal.2d 636, 640 [4] [134 P.2d 242].)
The judgment is affirmed.
Gibson, C. J., Shenk, J., Traynor, J., Sehauer, J., and Spence, J., concurred.
Assigned by Chairman of Judicial Council.
After the argument of this ease, Robert G. Weil, by order of the superior court, was substituted as party-plaintiff for Rowland. Similarly, Weil has been substituted for Rowland as party-appellant.