The original defendant in this suit was Lndwig Gebhart, who has died since the appeal was taken and the present defendants, who are his children and heirs at law, have been admitted as parties in. his stead.
The suit was begun as an action in ejectment for the possession of eighty, acres of land, but by the answer it was converted into a suit in equity.
The averments in the answer were to the effect that in 1889 the defendant Gebhart, by his attorney Kelly, the plaintiff in this suit, brought suit against one Corse to recover the value of certain improvement that he (Gebhart) had placed on the land in question; that Corse answered in that suit by general denial only, and • the cause coming on for trial the court found the value of the improvements sued for to be $1,600, the value of the land independent of the improvements to be $200, rendered judgment against Gebhart for $200 and decreed that execution issue to sell the land to satisfy that judgment; that execution did accordingly issue, the land was sold thereunder by the sheriff to Kelly, the plaintiff in the case at bar, to whom the sheriff delivered a deed. Then the answer avers that that judgment was null and void, and the sale thereunder was void, and prays that the deed be cancelled, etc. Reply, general denial.
On the trial the plaintiff Kelly introduced the following evidence:
1. A judgment of the circuit court dated February, 1887,,in favor of one A. Corse against Ludwig Gebhart for the possession of this 80 acres and $10 damages.
2. A deed of trust dated August, 1887, from Ludwig Gebhart conveying this land to A. S. Long, trustee, to secure a note for $100 to Kelly and J. B. Harrison, and a note for $100 to Kelly, both made by Gebhart, both due August 9, 1888.
*5923. A judgment of the circuit court dated August 8, 1890, in the words and figures following:
“Ludwig Gehhart v. A. Corse.
“This cause coming on to be heard the parties plaintiff and defendant appear and announce ready for trial, and by agreement of parties the issues are submitted to the court, and by agreement the court finds that the defendant is entitled to the lands described in plaintiff’s petition as follows: South half of the southeast quarter, section thirty-four, township thirty-eight, range seven west, containing 80 acres. That the plaintiff is and has been in the possession of said land, claiming title thereto, since the--day of December, 1880. That the value of said lands, without improvements •made by plaintiff, is $200. That the value of improvements made by plaintiff is $1,600. It is, therefore, decreed by the court that the plaintiff pay defendant two hundred dollars on or before the first day of October, 1890, and that on the payment of such sum of $200 to defendant, A. Corse, on or before the said 1st day of December, 1890, the defendant arid' those claiming under him since the filing of this suit, shall be divested of all title to said lands. That the said $200 'is hereby declared a lien on said land and unless the same be paid within the times above mentioned! and ■specified, execution shall issue by the clerk of this court, ■commanding the sheriff of Phelps county, Missouri, to sell said real estate to satisfy said sum of $200, and •costs of this suit.”
4. A deed from the sheriff to plaintiff Kelly to “the land in suit under execution of that judgment.
The defendant introduced the following evidence:
1. The petition in the suit of Gebhart v. Corse in which the judgment above shown was rendered. That petition was in substance to the effect that in December, 1880, one Louisa Snay, a married woman, sold the land in question to Gebhart for $150 in cash, which he paid *593to her, and the assumption of payment by him of two notes of Louisa Snay, amounting to $150, owing to one Allen, and secured by deed of trust on the land duly recorded, which notes he afterwards paid; that Louisa Snay and her husband executed a deed to him and put him in possession of the land on December 16, 1880, and he has been in possession of the same ever since; that the deed so given to him was not acknowledged as the law required for the acknowledgment of a deed by a married woman selling her land, a fact of which he was at the time ignorant, and the consequence was that in a suit against him a judgment for .the possession of the land was rendered in the circuit court in February, 1887, in favor of A. Corse who had a better title; that whilst he was in possession and before he had notice of the claim of Corse he made certain specified improvements amounting in value to over $3,000. The prayer of the petition was that an account be taken of the rents and profits of the land while in his possession, and of the value of permanent improvements so made, and of the amount he had paid for the purchase money and interest, that he be subrogated to the rights of Allen in the deed of trust which he had paid off, and that -Corse be enjoined from taking possession of the land until he should pay the amount of the value of the improvements and the purchase money and the Allen debt, less the amount of the rents and profits, etc.
2. The answer to that petition, which was a general denial.
3. The evidence for defendants also showed that the plaintiff Kelly had been attorney for G-ebhart in a criminal suit against him and was his attorney in the suit against Corse for the value of the improvements. That the deed of trust in evidence was given to secure Kelly and Harrison for their fees in the criminal case. Gebhart retained possession of the land throughout all the litigation.
The finding and judgment were for the plaintiff for *594the possession of the land, bnt the court also found that at the time the plaintiff bought the land at the sheriff’s sale he was the attorney for Gebhart and that that relation fixed a trust character to the title taken; the court found the plaintiff had paid the sheriff $200 for the purchase price, which with interest up to the date of the judgment amounted to $320, and also that there was due the plaintiff from Gebhart on the deed of trust in evidence $345; also that at the time of his purchase the plaintiff executed a deed of trust on the land for $100, which with interest to date amounted to $180. It was adjudged that if the defendant should elect to pay the plaintiff $320, and the $345 above mentioned with six per cent interest by a day named, such payment when made should be a satisfaction of the judgment in plaintiff’s favor for possession of the land, and that if defendant should pay the $180 deed of trust such payment should go as a credit against the amounts to be paid to plaintiff, and upon such payments the plaintiff should execute a deed to defendant for the land. Prom that judgment the defendant appealed.
The proposition on which the defendants mainly-rely is that the judgment in the suit of Gebhart v. Corse was null and void because it was not responsive to the pleadings; therefore, the sheriff ’s deed under the execution was invalid; and that deed being the only show of legal title in the plaintiff, he was not entitled to recover.
Appellants’ analysis of the judgment is that it adjudges the land to belong to Corse, Corse to recover of Gebhart $200, and Corse’s own land to be sold to pay the debt Gebhart owes him. We think that is a misconception of the judgment.
The effect of the judgment is that whilst the legal title to the land is in Corse, yet Gebhart has an equitable interest in it to the extent of $1,600, and it is that interest that is decreed to be sold to satisfy the judgment of $200 in favor of Corse, and since the sale is for *595the benefit of Corse, it of course carries Corse’s title also.
Appellants contend that that was a proceeding’ under the statute, sections 3072-3079, Revised Statutes. 1899, and that no judgment could be rendered except as-, in the statute prescribed; that in that case no judgment for the value of the land could go against G-ebhart, the plaintiff there, because Corse in his answer had not offered to relinquish the land upon payment to him of the value thereof as prescribed in section 3075.
In Cox v. McDivit, 125 Mo. 358, which was a case under this statute, the judgment required the plaintiff to pay the value of the land and take a deed therefor from the defendant, and in default of such payment the defendant was to have the land discharged of the claim for improvements. That judgment was reversed by this court on appeal for the reason that the defendant in his answer had not offered to relinquish the land and take the value thereof as provided in section 3075, the court holding that such an offer was necessary in order to give notice to the plaintiff that the value of the land would be a question at the trial. But as was recognized in that case, the giving of such notice may be waived, and if waived, the necessity of the offer to relinquish is obviated. The record in the case of Gebhart v. Corse shows that the value of the land and that of the improvements was fixed at the trial by agreement of the parties and assessed by the court according to the agreement; notice, therefore, that the value of the.land would be in issue at the trial was waived.
Whilst it may be that the plaintiff in that suit aimed to bring his .case within the terms of the statute above referred to, yet an examination of his petition shows that he did not confine himself strictly to the statute, but injected into his petition some statements tending to show that he had an equitable interest in the land superior to the defendant’s legal right, and he prayed judgment thereon.
*596The statute in question, section 3072, is designed to enable one who, in good faith, has made permanent valuable improvements on land of which he is in possession and believes he is the owner, to have compensation for such improvements when he is dispossessed by one holding a better title. In such case he may file his petition (section 3073) -stating the nature of his title, the length of his possession, the kind and value of the improvements, his good faith, etc. In strict conformity to the statute the only relief he can ask is compensation for his improvements. But in Gebhart v. Corse the plaintiff went beyond the strict limit of the statute and set up in his petition the deed of trust to Allen which he stated was senior to Corse’s title, and which he had paid under the terms of his purchase from Louisa Snay, and he prayed to be subrogated to Allen’s rights. If, therefore, the judgment in that case did not conform strictly to the statute it was no farther wide of the mark than was the petition. The court had jurisdiction both of the parties and the subject and was competent to adjudge between the parties their rights respectively in relation to the subject in controversy as set out in their pleadings. This the court, by its decree, undertook to do, and if there is anything wrong about the judgment it is only an error which either party, if he felt aggrieved, could have had corrected in the proper appellate court. But both parties seem to have been satisfied, there was no appeal taken, there was not even a motion for a new trial. Under those circumstances the judgment is to be taken as valid and conclusive between the parties, and as to them the legal title to the land passed under the sheriff’s sale. The court correctly adjudged the title to be in the plaintiff Kelly, and also correctly held that as he was the attorney for Gebhart his title was impressed with a. trust in Gebhart’s favor, and that Gebhart was to have the land when he should pay Kelly what he honestly owed him. The date at which the rights of Kelly and Gebhart respec*597tively with ref erence to the land, growing ont of Kelley’s purchase at the sheriff’s sale, were to be adjudged, was the date of that sale. At that date the debt due under the deed of trust was in full force.
The decree gave Gebhart all that he was entitled to and his heirs have no cause to complain of it.
The judgment is affirmed.
All concur.