This is an action to foreclose a mortgage made by Alice E. Atwood and her husband, W. H. Atwood, upon the separate property of the wife. Mrs. Atwood defends upon the ground that the loan of $1,000 which the mortgage was made to secure was made to her husband for his solé use and benefit, and that she signed the note and pledged her property for its payment, as surety for her husband. She further alleges that the plaintiff had within his control funds belonging to her husband sufficient to discharge the mortgage debt, and that he voluntarily released the same without her knowledge or consent. It is elementary law that a creditor who by his voluntary act parts with security for his debt thereby releases a surety or guarantor, to the extent of the value of the security parted with. Bronson v. McCormick Harvesting Machine Co., 52 Nebr., 342; City of Maquoketa v. Willey, 35 Ia., 323; Commercial Nat. Bank v. Henninger, 105 Pa. St. 496. This requires us to examine the record, and to ascertain whether the plaintiff has so conducted himself in relation to this debt, and to any fund belonging to W. H. Atwood of which he had control, as to release Mrs. Atwood and her property from liability'therefor. The evidence discloses that G. A. Davis and H. A. Pierce of Castthe, N. Y., were engaged in the banking business in their home city, and also carried on a real estate loan business in Nebraska. Ini 1888 W. H. Atwood commenced attending to their business in the city of Fremont, and vicinity,—making loans, collecting interest and matured loans, and acting as their attorney in such foreclosure proceedings as-were necessary. In July, 1894, W. H. Atwood borrowed of Davis & Pierce, $1,000, *94his wife joining in the note, and executing the mortgage in controversy to secure the same. The mortgage covers the residence of the Atwoods, the title to which stood in the name of the wife-; and we may assume that Davis and Pierce had knowledge of her title, as they had made a previous loan on this same property, and an abstract of title had been examined and approved by them when the first loan was made. In 1896 Atwood ceased collecting for Davis & Pierce, but continued to attend to certain foreclosure cases as their attorney. Atwood testified at that time a dispute arose over the amount due him from the firm, and that he requested a settlement and an application of the amount due Mm for services in discharge of this mortgage. The conversation relating to this matter was had with Davis, who died previous to the trial, and under the ruling in Mead v. Weaver, 42 Nebr., 149, this evidence can not be considered, being incompetent under section 329 of our Code of Civil Procedure. In May, 1896, a fee of $375 due Atwood in what is called the “Nielson Case” was applied on this loan, being used to pay one matured coupon, and $301, indorsed on the principal note. In November, 1895, a second mortgage was made upon the premises to Mrs. Cotterell, who- fthed a cross-bill in this action and obtained a decree of foreclosure; but, as no tenable objections are made to the decree so far as it directs a foreclosure of this mortgage, it will not be further considered. In 1897 there were two cases pending in the circuit court of the United States for the district of Nebraska, brought by Davis & Pierce to foreclose mortgages held by them. In both cases Atwood was attorney for the plaintiffs. In one of these, known as the “Abbott Case,” Atwood collected the sum of $2,630.48. With $2,-530 of this sum he purchased three drafts payable to his own order, retaining the balance in cash. He then fthed an attorney’s lien in the other case, which is called the “Meays Case,” claiming $7,000, due him for fees for services performed for Davis & Pierce. The plaintiff thereupon formally discharged him as attorney in the case, and he *95then fthed a petition in intervention setting out his claiir for services, and Pierce, the surviving partner, fthed an answer and cross-petition. In December, 1897, the three drafts purchased by Atwood were deposited in escrow with one Briggs, under the following agreement made between the parties:
“Whereas, the amounts represented by drafts No. 172.-817, and 172,818, and 172,819, aggregating $2,530, drawn by First National Bank of Fremont on Chase National Bank in favor of William H. Atwood, are in dispute between said Atwood, on one part, and H. A. Pierce and the executors of Gthes A. Davis, on the other part, each party claiming the same, which dispute is about to be litigated in the United States Court. It is hereby agreed that said drafts shall be and hereby are placed on deposit with A. H. Briggs to be by him held until the termination of said dispute in court, and then delivered to the successful party. In case the amount thereby rejmesented shall be divided, said A. H. Briggs shall cash said drafts and apportion the proceeds.”
In the cross-bill fthed by Pierce in the Meays case in the federal court, he set out the note secured by the mortgage in controversy in this action as a demand against Atwood.
A special master was appointed to report the facts under the law, and, after hearing the evidence, reported that “at the time William H. Atwood fthed his intervening petition herein he had in his hands, as moneys of the cross-complainant, the sum of $2,630.48,” and “that the services rendered to the said complainant by the said William H. Atwood were of the value of $1,592.39, and that the said William H. Atwood is entitled to receive said last-named amount as compensation for services rendered the said complainant,” and “that the said William H. Atwood is indebted to the said cross-complainant upon the promissory note and coupon mentioned in the answer and cross-bill of Henry A. Pierce herein, and that the said note and coupon evidence a valid and subsisting obligation,” and “that the cross-complainant herein is entitled to the entire *96fund paid into this court upon the foreclosure proceedings in the above-entitled cause,” and “that the cross-complainant herein is entitled to receive the said sum of $2,630.48 received by William H. Atwood as aforesaid, less the said amount of $1,592.39, the amount to which said William H. Atwood is entitled for his services aforesaid,” and “that this disbursement will settle and pay all matters in controversy between said Atwood and said Pierce, except that said Atwood will still owe to the said Pierce the two notes mentioned in the cross-complaint of said Pierce,—one of said notes being for $1,000 face, dated July 26th, 1894, and the other one being for $70 face, of the same date, each having an indorsement thereon,”—and the following conclusions of ]aw:
“(1.) I find that the complainant in said cross-bill, Henry A. Pierce, is entitled to receive the entire funds paid into this court upon the foreclosure proceedings in the above-entitled cause. (2.) I find that the complainant in said cross-bill, Henry A. Pierce, is entitled to receive of the $2,630.48, received as aforesaid, by said William H. Atwood, the sum of $1,038.09. (3.) I further find that said William H. Atwood is entitled to retain of the $2,630.48 received by him the sum of $1,592.39. (4.) I further find that the promissory note and coupon executed by the said William H. Atwood, and mentioned in the amended cross-bill of the said Henry A. Pierce herein, is a valid and subsisting obligation, and evidences a valid indebtedness from said William H. Atwood to said Henry A. Pierce. (5.) I further find (being requested by the parties to make a finding as to costs) that the costs of this proceeding should be borne and paid by the said cross-complainant, Henry A. Pierce. (6. ) I further find that a decree should be entered herein, upon the issues aforesaid, awarding out of the $2,630.48 aforesaid, the sum of $1,592.39 to the said William H. Atwood, and the said $1,038.09 to the said cross-complainant, Henry A. Pierce, and awarding to the said Henry A. Pierce the entire sum. paid into this court upon the foreclosure proceedings in the above-entitled cause, *97and adjudging the indebtedness evidenced by the promissory note and coupon signed by said William H. Atwood, and mentioned in the amended cross-bill herein, to be valid and subsisting, ánd decreeing that the said complainant, Heiiry A. Pierce, pay the costs of this proceeding, and that judgment against him be entered therefor, and that execution be 'awarded thereon; that this settlement and disbursement of the funds be decreed to cancel all matters in dispute between the parties under the issues of this case, except that said note and coupon signed by said William H. Atwood, and now held by said Pierce, remain unpaid and a subsisting obligation from said Atwood to said Pierce thereon.”
Shortly after the filing of this report the following stipulation was made and fthed by the parties:
“Comes now William H. Atwood, interlocutory petitioner, and Henry A. Pierce, cross-complainant, and stipulate and move the court that the findings of fact of W. D. McHugh, special master, be approved, and that the conclusions of law of said special master be approved except as to the taxation of costs, and that decree be entered in accordance with the recommendation of said master, except that no attorney’s docket fee be taxed in this controversy, and that the costs of this controversy be taxed equally against the interlocutory petitioner and cross-complainant.”
A decree was thereupon entered conforming to the master’s report, and thereafter the money in the hands of Briggs was by him paid over to Pierce and Atwood; each receiving the amount awarded Mm by the master’s report.
It will be seen that, after the Abbott Case had been disposed of, issues were made up between Atwood, on the one part, and Davis and Pierce, on the other, involving the whole controversy between them, including the note herein sued upon, which Davis and Pierce had brought into those issues as a claim in their favor against Atwood. The is* sues being in that condition, the money, $2,530, which both parties to the litigation claimed, was by agreement be*98tween the parties placed, in the hands of a third party, to be held by him “until the termination of said dispute in court.” The meaning of the stipulation, clearly, is that whatever shall be due to either party out of this money on deposit upon the final determination of the court of all of the issues then presented to the court shall be’ paid to the party to whom it is due. It is clear that a court of equity would enforce this agreement, and that there was no way in which Atwood could get this money for his own use without satisfying the whole claim of Pierce & Davis, unless Pierce & Davis should voluntarily turn the money over to him. The master’s report is predicated upon the idea that Pierce & Davis would release their claim on a part of the funds in the hands of Briggs, and dismiss their suit as to the note in question, and reinstate the note and hold it against Atwood. This idea was undoubtedly inspired by the parties themselves as the law would not have made such a disposition of the case without the consent of both parties, and, indeed, the consent of the parties is contained in their stipulation fthed shortly after. The decree of the court was entered according to the stipulation. Could Pierce and Davis, after consenting that this money should be paid to Atwood, still hold the homestead of Mrs. Atwood, which she pledged as guarantor for her husband ?- The weight of authority is that a'surety, when sped for the debt of his principal, may offset a claim which is due to the principal from the creditor. 1 Brandt, Suretyship & Guaranty, sec. 286. Our statute provides that, “when cross-demands have existed between persons under such circumstances that if one had brought an action against the other a counter-claim or set-off could have been set up, neither can be deprived of the benefit thereof by assignment or death of the other, but the two demands must be deemed compensated, so far as they equal each other.” Code of Civil Procedure, sec. 106. And it is insisted that the common-law rule that the creditor may pay an independent debt which he owes to the principal, and still hold the sureties liable for the whole debt guaranteed by him, *99does not obtain in this state, or, at all events, if the creditor bas any lien upon or any means of controlling the application of any funds of the principal, so as to make it available in the satisfaction of bis claim, be can not,relinquish sucb fund to the principal without releasing the surety, and we think that this is undoubtedly the rule. In City of Maquoketa v. Willey, 35 Ia., 323, it is said:
“The creditor, however, can not relinquish any bold be bas acquired upon the property of the debtor without resorting to the proper proceedings to make therefrom the debt. And this rule is alike applicable if the property bas been voluntarily placed in the bands of the creditor, or be bas acquired a lien thereon by proceedings at law. This is unquestionably the rule of the authorities. They will be found collected and discussed in 3 Leading Cases in Equity (Hare & Wallace’s notes, p. 552, Rus v. Berrington) and 2 Am. Leading Cases, 260 (Hare & Wallace’s Notes to Pain v. Packard and King v. Baldwin). See upon this point Chambers v. Cochran & Brock, 18 Ia., 159. This rule is well founded upon the equitable doctrine that be who, by bis wilful act, causes a loss, ought to endure its consequences and not transfer its effects to an innocent party. The creditor, having in bis bands property to secure the debt,- voluntarily placed there by the principal debtor, would not be permitted to relinquish it or appropriate it to other purposes. By sucb an act the property would be lost so far as the satisfaction of the debt is affected. The case is not different if the property should come to the bands of the creditor by bis own act, as through the institution of legal proceedings. In either case it is plain that equity and fair dealing toward the surety demand that be appropriate the property to the payment of the debt.”
The question of the ownership of the property, and the right of the creditor to apply it upon bis claim, bad, in a former action, been submitted to a referee, who had reported that the property belonged to a third party and was not applicable upon the claim of the plaintiff. The *100parties afterward stipulated that- the report of the referee should be confirmed, which was done. Upon this branch of the case the court said:
“The judgment was rendered upon the referee’s report without objection and upon the consent of the city; that is, of its attorney in the case, for whose act in this matter the city must be held responsible. As we have seem, the judgment was unauthorized by law. It is then the case of a judgment by consent adverse to the rights and interest of the defendant. Under it certain property upon which the city had a legal hold for the satisfaction of its claim against Murphy was discharged and thus lost to defendant. It was a voluntary relinquishment, for the judgment by consent, contrary to the rules of law and the rights of the parties, must be so considered. Under the principles above announced, the loss resulting therefrom must be borne alone by the plaintiff.”
And so in the case at bar the money was so placed that it was under the control of the plaintiff, so that without his consent its application upon his claim could not have been prevented. It is manifest that under such circumstances his consent that this money be paid to the principal debtor would release the surety.
The decree of the district court, on the petition of plaintiff, is reversed and the cause remanded with instructions to dismiss the action as to Mrs. Ativood, and to render judgment for the amount of the note and interest against Mr. Atwood. The decree, on the cross-petition of Cotterell, is affirmed.
Judgment accordingly.