BELCHER, C.
The plaintiffs brought this action to obtain a perpetual injunction restraining the enforcement of a deficiency judgment entered against them in a suit to foreclose a mortgage. The facts stated in the complaint are in substance as follows: On or about December 30, 1887, the plaintiffs, Ella M. Heim and Julius F. H. Heim, her husband, executed to the defendant their promissory note, bearing interest at the rate of six per cent per annum, payable monthly in advance, and, if not so paid, to become immediately due, at the option of the holder thereof. At the same time, to secure payment of the note, they executed to the defendant a mortgage upon certain real property in Sonoma county. Subsequently they conveyed the mortgaged property to other parties, upon the express condition that the grantees should assume the payment of the said note and mortgage. Thereafter, about September 1, 1891, the grantees having failed to pay the interest on the note, “and the said defendant herein having elected' and declared said note to be due and payable, defendant herein, being requested, by plaintiff Ella M. Heim to commence proceedings for the foreclosure of said mortgage, did agree with her that he would commence an action for such foreclosure, and, upon obtaining judgment in said cause and a decree of court directing the sale of said property to satisfy said judgment, he, this defendant, would at such sale purchase the same for the amount of such judgment obtained, including interest and costs at that time accrued ; and he, the said defendant, did expressly agree with the said plaintiff that no personal judgment in said action should ever be entered or docketed against plaintiffs, or against either of them.” On September 11, 1891, defendant commenced an action in the superior court of Sonoma county to foreclose his said mortgage; and such proceedings were had therein that on January 4, 1892, judgment, foreclosing the mortgage, and directing a sale of the mortgaged premises to satisfy the same, was duly given and made against the defendants therein (plaintiffs herein), for the sum of, $4,702.25, and $250 attorneys’ fees. ' Thereafter, on February 29, 1892, the mortgaged property ’was sold by the sheriff of the county under and by virtue of said judgment. “That these plaintiffs relied upon said promise and agreement of the said defendant, and, so relying and believing that said defendant would keep and perform the same, these plaintiffs, *21and both of them, failed to appear or answer in said foreclosure suit though made parties thereto, and permitted their defaults to be entered therein; and thereafter, so relying and believing in said promise of defendant, they abstained from being present at said sale, or talcing any step whatsoever to obtain a purchaser for said property, so that their interests in said judgment might be protected and exonerated; and these plaintiffs, and both of them, furthermore did, by reason of their reliance upon said promise of defendant, refrain from making or causing to be made any bid at said sale, although at that time they were fully able to purchase said property for the amount of said judgment, and thereby to protect themselves against said judgment.” Notwithstanding his said promise, and in violation thereof, the defendant failed to purchase the property at said sale for the amount of said judgment, but instead thereof purchased the same for the sum of $4,200. From this sum were deducted the sheriff’s commissions and expenses in making the sale, leaving $4,195.95, which was credited upon the judgment; and thereafter, on the same day, in violation of his said agreement, the defendant caused a personal judgment to be docketed in said cause against these plaintiffs, and each of them, for the sum of $918.43, which personal judgment has since remained and still is in full force and effect against them. Defendant has refused to cancel said judgment so far as these plaintiffs are concerned, and now threatens to take out an execution against them, and to satisfy the same by the sale of other property belonging to them, to their great and irreparable detriment and harm. No demurrer to the complaint was interposed. Defendant answered, denying that he made the promise or agreement set out in the complaint, admitting that he caused a deficiency judgment for $918.43 to be docketed in the said action on February 29, 1892, and that the judgment so docketed has been and still is in full force and effect against the plaintiffs, but denying that the same was docketed in violation of any such promise or agreement as is alleged in the complaint, or in violation of any promise or agreement of defendant with plaintiffs, or either of them, or with anyone else. At the trial it was proved, without objection, that the plaintiff Ella M. Heim, purchased the mortgaged property from the defendant for the sum of $5,500, and that the terms of the purchase were $600 cash, *22one note for $500, due on or before January 1, 1889, and one note for $4,400, due on or before January 1, 1893; both notes drawing interest at six per cent per annum, payable monthly in advance, and secured by a mortgage on the property executed by her and her husband. The plaintiffs then sought to prove the agreement as alleged, and that they relied and acted upon it, and therefore did not appear in the foreclosure suit, the improvements placed upon the property during the time Mrs. Heim owned it, and its value at the time of the foreclosure, and that but for the agreement they or one of them would have been present at the sale, and bid in the property for the purpose of protecting themselves. This evidence was all objected to by defendant, upon the ground, among others, that the complaint did not state facts sufficient to constitute a cause of action, and the objections were sustained, the plaintiffs reserving exceptions. No further evidence was offered by the plaintiffs, and the cause was then submitted on their behalf. Thereupon counsel for defendant moved for a nonsuit, upon the ground that the complaint did not state facts sufficient to constitute a cause of action, and the plaintiffs had not proved anything that would entitle them to .recover. The motion was granted, and from the judgment and an order denying their motion for a new trial the plaintiffs appeal.
The question, then, is, Did the complaint state a - cause of action? If it did, the court erred in excluding the offered evidence and in granting the nonsuit. It is claimed for respondent that the complaint was insufficient, because the agreement set up was without any consideration and void. Section 1605 of the Civil Code provides: “Any benefit conferred, or agreed to be conferred, upon the promisor by any other person, to which the promisor is not lawfully entitled, or any prejudice suffered, or agreed to be suffered, by such person other than such as he is at the time of consent lawfully bound to suffer, as an inducement to the promisor, is a good consideration for a promise. ’ ’ Under this provision, if, as alleged., the plaintiffs, in reliance upon the defendant’s agreement, allowed their defaults to be entered and refrained from being present and bidding at the sale, thus surrendering their legal rights, a benefit was conferred upon the defendant, and a prejudice suffered by them, which, in our opinion, constituted a good and sufficient consideration for *23his promise to purchase the property for the full amount of his judgment, and that no deficiency judgment should be entered against them: See Montgomery v. Gibbs, 40 Iowa, 652.
It is also claimed that the complaint was insufficient for the following reasons: (1) Because the effect of the agreement set out was to alter the terms of the note and mortgage, which, under section 1698 of the Civil Code, could only be done by a contract in writing, or by an executed oral agreement; (2) because the direct effect of the agreement was to prevent bidding at the execution sale, and it was therefore against public policy and void. We are unable to see how either of these points can be sustained. The agreement did not in any way alter the terms of the note or mortgage. It simply, as in Montgomery v. Gibbs, supra, obligated the defendant to limit his remedy to the property sold. Nor did it prevent bidding at the sale, but only required the defendant to bid for the property the full amount of his judgment.
It is further claimed that the complaint was defective because it contained no allegation that defendant made the agreement with intent to deceive or mislead the plaintiffs, or with any fraudulent intent whatever, but shows that the agreement was made before the foreclosure suit was commenced, and that plaintiffs had an opportunity to appear therein, and neglected to do so, and that they lost their rights, if any they had, under the agreement, by reason of their own negligence. We do not perceive that it can make any difference whether the agreement was made before or after the suit was commenced. It was evidently made in view of the suit, and its purpose was to save the plaintiffs from the trouble and expense of appearing in the case, and being present and bidding at the sale; and, being made, plaintiffs had a right to rely upon it, and to expect the defendant to carry it out in good faith, and were guilty of no negligence in doing so. If, however, the allegations are true, the defendant’s failure to carry it out constituted an actionable fraud or wrong, which entitled the injured parties to relief.
Finally it is claimed that the complaint was insufficient, because it does not appear therefrom that the plaintiffs had any defense to the foreclosure suit, or that they could have prevented the entry of the deficiency judgment, or that the land mortgaged was worth more than the sum for which de*24fendant bid it in, or that plaintiffs could have procured anyone to bid more, or that they would have bid more themselves if present at the sale, and hence that there is no showing that plaintiffs had been damaged. The complaint avers that the plaintiffs relied upon the promise and agreement of the defendant, and, so relying and believing that he would keep and perform the same, they “failed to appear or answer” in the foreclosure suit, and that thereafter, so relying and believing in said promise, “they abstained from being present at said sale, or taking any steps whatsoever to obtain a purchaser for said property,” and, “furthermore, did, by reason of their reliance upon said promise of defendant, refrain from making or causing to be made any bid at said sale, although at the time they were fully able to purchase said property for the amount of said judgment, and thereby to protect themselves against said judgment.” The fair import of this language, it seems to us, is that, but for the agreement of defendant, plaintiffs would have appeared and answered in the suit, and would have been present and bid for the property at the sale, or would have procured someone else to do so. The language, of course, is somewhat ambiguous and uncertain, but, as no demurrer was interposed, that ground' of objection was waived. That the plaintiffs were damaged by their failure to appear and answer in the foreclosure suit, and to be present and have an opportunity to bid at the sale, is clearly shown, inferentially at least. After the mortgage was executed, they sold the property, and the grantees assumed the payment of the mortgage debt. As between themselves, the grantees thereupon became the primary debtors, while the mortgagors occupied the relation of sureties, responsible to the mortgagee alone: Wilts. Mortg. Forec., sec. 223. Both the purchasers and the mortgagors were proper parties to the action to foreclose, and the plaintiff therein- was entitled to have the deficiency judgment entered against the former: Pellier v. Gillespie, 67 Cal. 582, 8 Pac. 185. It would seem, therefore, that the mortgagors would have been entitled, if present, to claim and insist, for their own protection, that such judgment should be entered against the purchasers as well as against themselves. And that the property was worth more than $4,200, the price bid by defendant, may be assumed from the fact that the plaintiffs were able and willing to purchase the same for the *25amount of the judgment. We conclude, therefore, that, in the absence of a special demurrer, the complaint was sufficient, and the objection that it did not state facts sufficient to constitute a cause of action should not have been sustained. The law applicable to the case is very clearly stated by Mr. Freeman in his work on Judgments (section 492, fourth edition), as follows: “It has frequently happened that one of the parties litigant has failed to present his claim or defense because he relied upon some agreement or understanding between himself and his adversary which, if observed, rendered such presentation unnecessary. And with more than occasional frequency, if we may judge from the reports, these agreements have b.een designed to lull a party into security and inactivity in order that some unconscionable advantage could be taken of him. In all such cases courts of equity, when asked to do so, have invariably restored the injured party to his rights under the agreement, and have wrested from his opponent all those fruits he had hoped to harvest and enjoy through fraud and duplicity.....Where A was sued upon a note and mortgage, and the plaintiff, for a valuable consideration, released him from personal liability, but took judgment in violation of his contract, and issued execution thereon, such execution was restrained on the ground ‘it was against conscience for the mortgagee to retain his advantage’ citing Hibbard v. Eastman, 47 N. H. 507, 93 Am. Dec. 467. “It makes no difference that the agreement is void because made on Sunday, or was oral, when the rules of the court required all stipulations to be in writing. If it can be shown that it was successfully employed to prevent the defendant from making his defense, then the plaintiff will not be allowed to retain the advantage it has secured him”; citing Blakesley v. Johnson, 13 Wis. 530. And see Thompson v. Laughlin, 91 Cal. 313, 27 Pac. 752, a case somewhat analogous to this.
The judgment and order appealed from should be reversed and the cause remanded for a new trial.
We concur: Searls, C.; Haynes, C.
PER CURIAM.
For the reasons given in the foregoing opinion the judgment and order appealed from are reversed and the cause remanded for a new trial.