March 19, 1888, Mordecai C. Maxwell and wife made a mortgage to the Dakota Mortgage Loan Corporation upon a tract of land in Dawes county to secure a note for $200, payable April 1, 1893, with interest at seven per cent, payable semi-annually. On the 4th day of September, 1889, the same persons made another mortgage upon this land in .favor of William Stewart and Alexander W. Stewart to secure the payment of a note for $800, payable September 1, 1894, with ten per cent interest, payable semi-annually. *519On the same day Maxwell and wife conveyed the land to James B. Kime and Simon J. Rice, the latter afterwards conveying to Kime. January 2, 1891, Moore, who liad succeeded to the ownership of the note in favor of the Dakota Mortgage Loan Corporation, brought this action to foreclose that mortgage alleging a default in several interest payments which, by the terms of the note and mortgage, permitted the holder to declare the whole debt due. He made defendants Kime, the Maxwells, and the Stewarts.
The Stewarts answered, setting up their mortgage and .alleging a default in the payment of several installments of interest then due as well as a further default because of the breach of the covenant against incumbrances contained in the mortgage; the incumbrance constituting the breach being the plaintiff’s mortgage.
Kime demurred, the language of his demurrer being as follows: “Come now the defendant, James B. Kime, by Spargur & Fisher, his attorneys, and enters herein his demurrer to the petition and cross-petition, and for the following reason: Because it appears upon the face of said cross-petition that it does not state facts sufficient to constitute a cause of action, or to entitle them to relief against this defendant.” This demurrer purports to be directed against both the petition and cross-petition, but states no ground of demurrer against the petition. Therefore, by virtue of section 95 of the Code of Civil Procedure it must be taken as a demurrer to the petition on the ground that ■it does not state facts sufficient to constitute a cause of action.
Mordecai Maxwell answered, admitting the execution of the plaintiff’s mortgage and denying all other allegations of the petition. He also asked that Alfred Bartow be made a party He then averred that he had put into the hands of Bartow $250, and constituted Bartow his agent for the purpose of paying such sum in satisfaction of plaintiff’s mortgage; that Bartow did not pay the same, but converted said *520sum to his own use. He prayed that Bartow be required to pay plaintiff’s mortgage, and the costs of the suit. No-order appears making Bartow a party, but he answered the cross-petition, setting up facts in accordance with what the evidence established on the trial.
The evidence showed beyond all controversy that Bar-tow was the agent of the Stewarts; that Maxwell applied to him for a loan; that Bartow informed him that the incumbrance caused by plaintiff’s mortgage must be cleared away in order to procure the loan, and that Maxwell assured him that it could be discharged at any time. Maxwell and Bartow then entered into correspondence with the-agent of the Dakota company with a view of procuring a. release of its mortgage. Bartow offered six months’ interest in advance as an inducement for the release. He afterwards offered to pay the debt with interest in full until its maturity. All this was with the knowledge of Maxwell. Pending the negotiations the mortgage to the Stewarts was executed. On September 9, 1889, Bartow and Maxwell were met with a point blank refusal on the part of the Dakota company to accept payment of its mortgage before maturity. It was then agreed between Maxwell and Bar-tow that Bartow should withhold from the $800, $256 as-security for the Stewarts against the plaintiff’s mortgage-A statement was then prepared on this basis and the remainder of the money resulting from the Stewart loan paid over to Maxwell. On these facts the court established the lien of plaintiff as a first lien and decreed foreclosure. It then found that Bartow, on behalf of the Stewarts, had withheld $256 to apply in payment of the plaintiff’s mortgage, and that three months from the date of the mortgage-to the Stewarts would have been a reasonable time for-making such payment and procuring a release. The court then established the mortgage of the Stewarts as a second lien, allowing interest on $800 for three months and interest on $544 for the remainder of the time — so ascertain*521ing the amount due on the Stewart mortgage as $678.43, and decreed a foreclosure. Kime and Maxwell appeal. Kime filed no pleading except the demurrer. There is no distinct order overruling this demurrer, but we think the decree reciting that the case had been submitted to the court upon the pleadings and evidence and then proceeding to award foreclosure, this was equivalent to overruling Kime’s demurrer. No defect in either petition or cross-petition is pointed out in the briefs. We have perceived no defect therein, and Kime having, by resting on his demurrer, confessed the averments of the petition and cross-petition, the decree was not erroneous as against him.
On behalf of Maxwell the argument is that the plaintiff’s assignor, having refused to receive payment of its mortgage, should not be permitted to foreclose before its maturity according to its terms; that, if this be not true, then the default was brought about by the failure of the Stew-arts to apply the money withheld by them in making .interest payments; that the Stewarts should not be permitted to foreclose on account of default in interest while withholding a portion of the loan greater than the interest due; that in any event under the facts the burden of the costs should be cast upon the mortgagees. The plaintiff certainly had a right to foreclose. The note, to secure which his mortgage was given, was payable at a day certain. The payee was not under any obligation to accept payment before maturity, and Maxwell acquired no rights as against him by offering to pay before; under his contact he had no-right to do so. The duty of the debtor was to pay the interest installments when they matured, and the principal debt when it matured. The right of the creditor was to receive payment at such times and not before. The appellants have, therefore, shown no defense against the plaintiff’s foreclosure, nor any equity whereby to subject the plaintiff to costs. As to the Stewarts, the case might be different if the appellants had not made default on their mortgage. *522The $256 was withheld as security against the first mortgage, and it is probable that the appellees had a right to expect this money to be applied to the payment of interest thereon as the interest fell due and that they might have required the Stewarts to answer for all loss or expense ■caused by their failure to so apply this fund. But the appellants did not pay the interest on the Stewart mortgage, and if the $256 was, as we are inclined to think and as the appellants claim, a fund for the payment of the first mortgage, then the Stewarts could not be required, and in fact they had no right, to apply it to the payment of interest on their own mortgage. It was the duty of the appellants to pay this interest, and having broken the contract upon their part they cannot defend against the foreclosure because the Stewarts failed to protect them against the first mortgage.
In one respect we think the court erred. Under the ■evidence we can see no foundation for allowing interest on the $256 withheld for three months or any other time. When the agreement was made it was known the first mortgagee would not accept payment, and there was no occasion for the Stewarts to keep this money for any time at the disposal of Maxwell. It was simply withheld to meet the first mortgage when it matured, and neither Maxwell nor Kime had the use thereof. The amount found due on the mortgage should, therefore, be reduced by $6.40 — the interest at the rate the mortgage bore on $256 for three months. So modified the decree will be affirmed, as under the circumstances we see no reason for not sustaining the discretionary act of the trial judge in taxing the costs against the appellants.
Decree accordingly