The opinion of the court was delivered by
Johnston, C. J.:R. J. Cabeen brought this action to quiet his title to a tract of real estate acquired through a sheriff’s deed executed in pursuance of an order of sale under a decree of foreclosure. *493The defendant Whalen claimed an interest under an oil and gas lease. Judgment was given for the plaintiff and defendant appeals.
In April, 1917, Ulysses Spriggs and May Spriggs, his wife, executed a mortgage to H. C. Whalen on the land in question to secure a loan which was made subject to a prior mortgage of $1,000. In April, 1921, Whalen brought an action to foreclose his mortgage. A judgment in hi's favor for the amount of the debt was rendered and declared to be a lien on the land subject only to the prior mortgage of $1,000. In pursuance of an order of sale the property was sold subject to the prior mortgage for $2,500 to D. A. Haworth, who was the highest and best bidder, and a certificate of purchase was issued to him, and the sheriff was ordered to make a deed at the expiration of eighteen months if the property was not redeemed. In July, 1922, Haworth assigned and delivered the certificate of purchase to Cabeen, and on April 4, 1924, a good and sufficient deed was delivered to Cabeen conveying the property subject to the prior mortgage. Whalen had helped the Spriggs to finance the indebtedness on the farm on which there appeared to have been several liens, helped them obtain the prior mortgage thereon that has been mentioned, took a second mortgage from them, and on the same day he obtained an assignment of a one-sixteenth interest in all the oil and gas that might be produced on the mortgaged land. In the foreclosure of his mortgage which purported to cover every interest in the land, except the prior mortgage, it was decreed that the lien on the land was subject only to the prior mortgage, and the sheriff was ordered to sell it and from, the proceeds to first pay the costs, then to pay to Whalen $2,115, the amount of his debt with accrued interest, and the residue, if any, to be brought into court there to be held until the further order of the court. It was further adjudged and decreed that the plaintiff and defendant, including the Whalens, be barred and foreclosed of all rights or equities in the land. Whalen was paid from the proceeds of the sale the amount of his mortgage debt; the purchaser bought the land without actual knowledge of the oil and gas lease, or of any reservation of interest, and his assignee did not know of any reservation, but supposed he was getting the entire interest in the property subject only to the prior mortgage. He did not know of any claim of an oil or gas interest until Whalen set it up after the deed was made. The assignment of the oil or gas interest to Whalen was dated April 16, 1917, and was placed on record September 16,1917. It recited that for and in con*494siderátion of $1 and other valuable consideration the Spriggs sold and transferred to Whalen the one-sixteenth interest in and to all oil or gas which should hereafter be produced on the land, describing it.
The question is whether the assignment of the mineral rights was excepted from the operation of the decree, or whether the sale under the decree conveyed to thé purchaser all the right, title and interest of the parties to the suit in the property conveyed. It is contended by the defendants that the purchaser took the land, subject to the rights of the lease, which was a matter of public record, and therefore he was a purchaser with notice. The purchaser at the judicial sale acquired not only the title and interests held by the mortgagor, but also all interest held by the parties to the action. Whalen brought the action and set up his mortgage asking for a foreclosure and sale of the property, but made no mention of any reservation of mineral rights. He invoked the aid of the court in.procuring a sale of the property, and on his own motion a judgment was rendered foreclosing his mortgage and adjudging that the rights and equities of the parties plaintiff and defendant should be barred. He did not complain of the judgment rendered nor ask to have his oil interest excepted from it. On the other hand, he procured an order of sale to be issued, which purported to cover every interest except the first mortgage of $1,000, and under that order the property was sold. On his motion the sale was confirmed and a deed executed, and out of the proceeds of the sale he received the full amount of the indebtedness secured by the mortgage. It is clear that he is not in a position to claim an interest not reserved in the judgment or at the judicial sale. The general rule is that in a judicial sale of property the deed conveys all the title and rights of the parties to the action, and also of all persons who have derived their interest from such parties during the pendency of the suit. (35 C. J. 73.) In the recent case of Poss v. Steiner, 118 Kan. 595, 236 Pac. 640, it was decided:
“Where the court had jurisdiction of all the parties the validity of a judgment in a foreclosure action, under which land is sold and a sheriff’s deed is issued, cannot be questioned by any of the parties thereto in a subsequent action by the grantee to quiet title to the land against those parties.”
A case closely in point is Ferguson v. Cloon, 89 Kan. 202, 131 Pac. 144, where a party holding a mortgage and a reversionary-interest in property brought a foreclosure action against the mortgagors, but made no reference to the reversion. He had conveyed *495the property to the mortgagors, and the deed contained the reversionary clause. The mortgage was foreclosed and the property sold by the sheriff in pursuance of the judgment. Afterwards the grantor and mortgagee asserted a right under the reversionary clause in the deed. After declaring the general rule that a purchaser of property at a foreclosure sale takes the title of all the parties to the action, it was ruled that the grantor of the property .not having mentioned or referred to the interest in reversion in the foreclosure action, but having cooperated in procuring a judgment and sale, proceeding as if the complete title and interest in the property were being subjected to the lien and sold, all the interests he had, as well as all the mortgagor had, passed to the purchaser by the sheriff’s deed.
The rule of caveat emptor is invoked by Whalen on the ground that his oil lease had been made a matter of record and therefore the purchaser had constructive notice of it and could take no more than the interest of the mortgagor. The same contention was made in the Ferguson case, where the deed containing the provision fór a reversion upon express conditions had been recorded. Because of this record it was insisted that the purchaser had constructive notice of the reserved interest and took the property subject to it. The court rejected this contention and held that the mortgagee having presented the case without reference to any reservation and having cooperated in procuring a judicial sale, as if all the interests were to be conveyed, was barred from asserting an interest under the reversion. It was held that it was optional with him whether he would exercise his right of reversion, and that even if the purchaser had actual notice of the interest, the plaintiff not having exercised the option by proceeding as if the mortgagor had the complete title, he could not exercise it after a judicial sale and the payment of the mortgage debt. So here, the purchaser although he had constructive notice of the oil lease had notice of other facts which had intervened, that is, he had notice from Whalen’s petition that no reservation was alleged and that no outstanding interest was claimed by him, and he also had notice through the decree that Whalen and all of the parties to the action had been barred from claiming any interest or equities.
We conclude that the decree sale and deed divested all the interests or claims of Whalen, and that the purchaser acquired the complete title, subject of course to the first mortgage of $1,000 which was expressly excepted in the decree.
The judgment is affirmed.