This is the second appearance of this case in this court. The opinion upon the former hearing is reported in 31 Ida. 390, 173 Pac. 117, where the facts are stated. Pending the appeal, the property concerned in the litigation was sold at sheriff’s sale pursuant to the judgment. After the remittitur was filed, Dean presented his petition to the district court asking for restitution by Crawford Moore, purchaser at the execution sale, of the amount *53of the purchase price of said premises represented by the judgment of MeReynolds, which this court had adjudged not to be a lien upon the property. At the hearing, it was shown that the land was bid in by Moore at the sale for the aggregate amount of his own liens and that of Rayburn, and the judgment of MeReynolds, pursuant to a written agreement by which on redemption of the property, or, if not redeemed, upon the sale thereof, the judgment lien should be discharged out of the proceeds in the order of their several priorities as set forth in the decree of the trial court. Moore did not pay the amount of his bid to the sheriff in cash, but in lieu of payment there was credited against his bid the amount of his liens and that of Rayburn, and the amount of the judgment of MeReynolds. By its judgment in this proceeding, the court decreed “that he, the said M. F. Dean, be and he hereby is substituted to all rights and privileges which W. D. MeReynolds could or might have had under and by virtue of the sale of the premises in this cause at the sheriff’s sale,” and decreed that the right to which he was substituted gave him a lien upon the premises subject to those of Moore and Rayburn. It further decreed that upon the sale of said premises, Dean should be entitled to participate in the proceeds thereof to the amount of his judgment, subject to the payment of the prior liens of Moore and Rayburn.
C. S., sec. 7171 provides: “When the judgment or order is reversed or modified the appellate court may make complete restitution of all property and rights lost by the erroneous judgment or order, so far as the restitution is consistent with the protection of a purchaser of property at a sale ordered by the judgment, or had under process issued upon the judgment on the appeal from which the proceedings were not stayed; . ”
Appellant lost no right by the erroneous judgment, except the right to redeem under the statute by paying the amount of the prior liens, exclusive of the MeReynolds judgment erroneously declared to be a prior lien, and the right *54to receive the proceeds of the sale in excess of such prior liens. Appellant did not seek to set aside the sale, and' he would not have been entitled to such relief had he sought it. (Barnhart v. Edwards, 128 Cal. 572, 61 Pac. 176. See, also, Falk v. Ferdheim Brewing Co., 67 Kan. 131, 72 Pac. 531.)
The remedy of restitution requires restoration of property which one has lost, on account of the execution of an erroneous judgment, by the party who has obtained it. This having been an execution sale, it was necessarily for cash, and the relationship of the parties is the same as if Moore had paid the amount of his bid to the sheriff and the sheriff had distributed the proceeds of the sale in accordance with the directions of the judgment.
Moore received nothing from the transaction that he was not entitled to receive. If his lien had been declared invalid and he had received credit therefor, he would have received a credit to which he was not entitled and would have been liable to appellant Dean therefor to the extent of Dean’s judgment. (Yndart v. Den, 125 Cal. 85, 57 Pac. 761; Patton v. Thomson, 3 Cal. Unrep. 871, 33 Pac. 97. See, also, Haebler v. Myers, 132 N. Y. 363, 28 Am. St. 589, 30 N. E. 963, 15 L. R. A. 588.)
Dean was not a party to the contract, pursuant to which the property was bid in by Moore, and cannot be required to become a party thereto, or to accept a substitution to McReynolds’ interest in the property.
The judgment, therefore, should not be affirmed, but should be reversed, with direction to dismiss the proceeding. It is so ordered. No costs awarded.
Budge and Lee, JJ., concur in the conclusion reached. McCarthy, J., sat at the hearing but took no part in the opinion.