The complaint in this case was filed October 21, 1897, asking that the plaintiff be subrogated to the rights of Ann North Leaker, under a mortgage which appellant paid to her in order to prevent a foreclosure thereof. The mortgage, at the time of this payment, was a proper claim upon the land and against the estate of the deceased. The land covered by the mortgage had, previous to the settlement of the estate, been conveyed to the appellant by the sole legatee under the will, under the representations that there were no debts except the mortgage in question, and that the estate was solvent. After appellant had paid the mortgage, a claim was allowed in favor of the brother of the deceased, which absorbed the entire estate, and left the appellant without anything to reimburse him for money paid to satisfy the mortgage. A demurrer was interposed to the complaint by the administrator, and sustained. The complaint was dismissed, and a judgment *90rendered in favor of the respondents, from which decree this appeal is taken.
1. In the argument of this case counsel have discussed the question of the application of the statute of limitations as a bar to recovery. No plea of the statute of limitations was set up in the answer or relied upon by any plea or demurrer thereto. Under section 4121, Comp. Laws Utah 1888, when a claim is presented against an estate for allowance in a case like this, the time within which claims must be presented is limited to 10 months after the first publication of notice to creditors. Under section 4123, Comp. Laws Utah 1888, unless such claim be presented, it is. barred, unless it appear that the claimant had no notice,, or was out of the state, etc. Section 4130, Comp. Laws Utah 1888, provides that “no holder of any claim against an estate shall maintain any action thereon unless the claim is first presented to the executor or administrator,, except in the following case: An action may be brought by any holder of a mortgage or lien to enforce the same against the property of the estate subject thereto.” Sec tion 4129, Comp. Laws Utah 1888, provides that “no claim must be allowed by the executor or administrator, or the judge of the probate court, which is barred by the statute of limitations. When a claim is presented to the judge for his allowance, he may, in his discretion, examine the claimant and others on oath, and hear any legal evidence touching the validity of the claim.”
These provisions of the statute have reference to the presentation and allowance of claims against the estate by and through the agency of the administrator and the probate court, and, under section 4130, the holder of a mortgage or lien may have recourse against the property subject thereto, without such presentation or allowance *91of the claim. Under section 4129, no claim can be allowed by the executor, administrator, or judge which is barred by the statute.
The notes given by the testator were dated September 30, 1890. One, for $2,500, was due one year after date, and the other, for $2,500, was due two years after date. The testator was out of the state one year. The appellant paid these notes, and the mortgage secured by them, August 1, 1895. The testator died November 18, 1893. Mr. Bailey was appointed administrator with the will annexed, February 1, 1894, and 10 months was allowed for the presentation of claims against the estate, computed from February 22, 1894, so that the time for the presentation of claims, without special application, expired December 22, 1894. The claim in question was not presented to the administrator or court for allowance until October 12, 1897, and this suit was brought October 21, 1897, so that, under these special provisions of the statute, the claim was. barred, as a proper claim for allowance against the estate, before it was presented for allowance, unless the failure' of the administrator to plead the statute of limitations removed the bar and rendered the estate liable.
We are of the opinion that, under section 4129, the claim was barred as a claim for allowance by the administrator against the estate, and that it was the duty of the-administrator to plead the statute against the allowance-of such claim, and that his failure to do so would not remove the statutory bar. The claim, being barred by the-statute for allowance against the estate, must be considered no debt for allowance under that statute. Under such circumstances there was no legal obligation to allow it, but, on the contrary, the legal duty to set up the bar of the-statute rested upon the administrator, under the provisions of section 4129. Upon his failure to plead it, the *92statute (section 4129) enacted for that special purpose created the bar. 3 Williams, Ex’rs (7th Am. Ed.) top p. 574; Butler v. Johnson, 111 N. Y. 204; Vrooman v. Li Po Tai, 113 Cal. 302; Smith v. Pattie, 81 Va. 654; Balz v. Underhill, (Sup.) 44 N. Y. Supp. 419; Hoskins v. Sheddon, 70 Ga. 528.
2. Under section 4130, above referred to, it was not necessary for' the claimant for subrogation under the mortgage to present his claim for allowance to the probate court. He had a right to bring this action to be subro-gated to the rights of Ann North Leaker, under her mortgage, by virtue of his alleged equitable claim and lien, without invoking the aid of the administrator or the probate court. Under section 3143, Comp. Laws Utah 1888, actions upon a contract, obligation, or liability,' founded upon an instrument in writing, must be commenced within four years. Under this section, if the defendant desired to interpose the statutory bar, it was his duty to plead the statute. This he did not do.
In Spanish Fork City v. Hopper, 7 Utah 235, this court held that, “in order to plead the statute, the answer should have stated and pleaded the section of the Code of Civil Procedure relied upon, or should have stated the fact's constituting the defense.” This is required by section 3244, Comp. Laws Utah 1888. Tunnel Co. v. Stranahan, 31 Cal. 387; Howell v. Rodgers, 47 Cal 291; Caulfield v. Sanders, 17 Cal. 569; Thomas v. Glendinning, 13 Utah 47-57; Farwell v. Jackson, 28 Cal. 105.
Under this general section of the statute, if the defendant desired to show that the action was barred, he should have pleaded the statute. This defense of the statute of limitations may be presented by demurrer, when it appears from the complaint that the statutory time has elapsed. Mason v. Cronise, 20 Cal. 211. But the statute of limitations cannot be raised under the demurrer that *93tbe complaint does not state facts sufficient to constitute a cause of action. Tbe statute must be pleaded. Brown v. Martin, 25 Cal. 82.
3. It appears that appellant’s note of $4,700 was due November 19, 1890. The deceased bad been out of tbe state one year. Tbe note would not become barred until November 19, 1895. Appellant surrendered this note, and took a conveyance of land covered by tbe Leaker mortgage, December 15, 1894. He paid tbe Leaker mortgage, August 1, 1895, before either of tbe notes surrendered or paid was barred, as a lien upon tbe land, under tbe general statute referred to. Appellant paid value for tbe discharge of tbe Leaker mortgage, and it was not barred when it was paid. Section 3150, Comp. Laws Utah 1888, provides that “an action for relief not heretofore provided for, must be commenced within four years after tbe cause of action shall have accrued.” This action to obtain a subrogation to tbe rights of Mrs. Leaker, to reimburse tbe appellant for money be was compelled to pay upon tbe debt of tbe estate to protect bis own interest, is an equitable action, not necessarily founded on a contract or written instrument, but was resorted to for tbe purpose of relieving a meritorious creditor from an unjust burden, who might otherwise be subjected to loss, by bis funds being applied to another’s debt; and, because of tbe peculiar rights and remedies, tbe suit does not come strictly within either of the restrictive provisions of the statute of limitations, except those of section 3150, above quoted. This section is doubtless intended to deal with the time in which certain complaints in equity may be filed, and “applies to all suits in equity not strictly of concurrent cognizance in law and equity.” Section 3150, Comp. Laws Utah, is the same as section 343 of the Code of Civil Procedure of California, *94and this construction was placed upon that section, by the supreme court of that state, in Piller v. Railroad Co., 52 Cal. 42. In Culmer v. Wilson, 13 Utah 129-149, 44 Pac. 833, this court held that, in an action for indemnity against actual damages, the party indemnified had no cause of action unless he was damaged, and the statute of limitations commenced to run from the time a certain .judgment was paid. The notes and mortgage were not barred, so far as the mortgagee’s rights to foreclose as against the land were concerned, when the appellant paid them. By paying the mortgage debt, appellant obtained an equitable lien upon the land independent from the mortgage. This lien arose by operation of law. By payment of the debt the appellant relieved the land from the burden of the mortgage, and this operated as a benefit to the estate to the amount of the mortgage debt paid, and thereby created the obligation on the part o'f the estate to reimburse the appellant, by way of a lien, to the extent only of the amount of the mortgage debt paid. When he paid the debt his lien attached. Until he paid the debt he had no lien or cause of action upon which the bar of the statute could operate. His right to a lien or subrogation only accrued when he paid the debt. The debt was not assigned to appellant because he paid it, but, on the contrary, it was extinguished. “Subrogation to the rights of • a creditor differs from an assignment of the debt, in that the latter assumes the continued existence of the debt, while the former follows upon its payment.” Sheld. Subr. §§ 4-6. So, by the extinguishment of the debt, appellant’s equitable lien upon the property was created. For this lien an equitable cause of action was created, and the statute of limitations commenced to run from the day he paid the debt. This doctrine is analogous to the rule -applicable in cases where the surety pays the debt of his *95principal. The statute of limitations, as between the principal and surety, begins to run from the payment of the debt by the surety, and not from the maturity of the original contract which created the indebtednes. Arbogast v. Hays, 98 Ind. 26; Scott v. Coleman, 27 Miss. 94; Hammond v. Myers, 30 Tex. 375; Burton v. Rutherford, 49 Mo. 255; Bennett v. Cook, 45 N. Y. 268; Sheld. Subr. §§ 4-6, 110; 1 Wood, Lim. 397; 2 Wood, Lim. 559; Scott v. Nichols, 61 Am. Dec. 503, and note, 504. In this case the appellant was compelled to pay a mortgage to prevent foreclosure and consequent loss to the estate and himself, on August 1, 1805, and his cause of action did not arise until he paid the mortgage on that date. Consequently his cause of action, as affecting the land, would not become barred by this provision of the statute until August 1,1899.
4. From the facts stated in the complaint, it appears that appellant had a claim against the Boggs estate of over $4,700. The only available piece of land left by the deceased was a lot incumbered for over $4,000, to Ann North Leaker, for the purchase price. On the 27th day of May, 1895, and more than five months after the time for the presentation of claims against the estate had expired, S. L. Boggs, a brother of the deceased, residing in Pennsylvania, presented a claim against the estate at Salt Lake City, for over $5,400. On the 15th day of December, 1894, Sarah G. Boggs, widow and sole devisee of the deceased, came to apellant in Denver, and desired a settlement of his note, amounting to $4,700, against the estate. She represented to appellant that she was the sole devisee by will in the Boggs estate; that, except the note held by appellant, there were no claims against the estate, except those secured upon certain land that would more thap doubly pay them; that the claim of Mrs. Leaker *96was secured by a purchase-money mortgage upon land reasonably worth $8,000, and that the equities therein, which belonged to and would be distributed to her as sole devisee, amounted to upward of $4,000 over and above the incumbrance, and requested appellant to take a deed of said property, subject to the Leaker mortgage, in settlement of his claim for $4,700. She represented that there was no question but what the lot covered by the mortgage would be distributed to her, and that it was hers under the will; that she could convey the same to appellant by deed, and give a perfect title thereto, subject to the mortgage; that, relying upon her representations, he accepted a deed from her of such property, subject to the mortgage, and surrendered the $4,700 note; that about the 1st of August, 1895, and without any notice of the filing of the claim of S. L. Boggs, said Ann North Leaker, having-threatened to foreclose for the balance of the $4,000 due on the purchase-money mortgage, he paid said mortgage to prevent the same from being foreclosed, and it was cancelled and discharged of record; that the Boggs claim was allowed by the probate court without his knowledge, but said claim was not allowed until after he had paid the Leaker mortgage, and not until five months after the time for presenting claims against the estate had expired; that, had he not paid the Leaker mortgage, it would have been foreclosed, and the property lost to the estate. After appellant learned of the allowance of the Boggs claim, he commenced this action, October 21,1897, asking to be sub-rogated to the rights of Ann North Leaker, under her mortgage as mortgagee. The administrator interposed a demurrer to the complaint on the grounds — First, that the complaint does not state facts sufficient to constitute a cause of action; second, the complaint does not allege that the appellant believed Mrs. Boggs’ representations to be *97true; third, that the appellant being a volunteer, is not entitled to subrogation.
Upon a consideration of the questions raised by the demurrer, we are satisfied that the allegation of the complaint was sufficient to show that the appellant relied upon and believed the representations of Mrs. Boggs, and surrendered his securities against the estate in reliance thereon, and that the estate was solvent and able to pay the Leaker mortgage, and that the appellant was not a mere volunteer, but directly interested to the amount of the Leaker mortgage, which should be paid out of the land covered by it belonging to the estate.
I am also of the opinion that the complaint states facts sufficient to constitute a cause of action. Appellant was led to believe that the estate was solvent, and relied upon Mrs. Boggs’ statements, as sole legatee, that she could and would convey a fee-simple interest in the lot covered by the Leaker mortgage. He was led to believe that no claim such as was presented by the brother of the deceased, and allowed after the time for the presentation of claims had expired, existed, or that any claim would consume the entire estate. Had appellant not paid the Leaker mortgage, it would have been foreclosed, and the land lost to the estate. The payment of the mortgage resulted in a benefit to the estate and an injury to no one. If subro-gation is allowed, no one is injured by it, as the estate and the heirs are no worse off. If appellant is allowed to be subrogated to the rights and position -occupied by Mrs. Leaker, no one is injured, and justice is meted out to the parties. The facts, to my mind, present a clear case calling for the application of the doctrine of subrogation, which is not alone founded upon contract, either express or implied, but upon principles of equity and justice, in*98tended to offer protection to a meritorious creditor, which does not conflict with the legal or equitable rights of others, and prevents a sweeping away of;the fund from which, in good conscience, he ought to be paid, and. which should properly be applied to .reimburse- one who has been compelled to pay the debt S'ofe.'a..third-person in order to protect his own rights or;save-his own property. Sheld. Subr. (2d Ed.) §§ 4-9; George v. Butler, 16 Utah 111; Johnson v. Tootle, 14 Utah 488; Spaulding v. Harvey, 129 Ind. 106, 28 N. E. 323; Acer v. Hotchkiss, 97 N. Y. 396; Duncan v. Gainey, 108 Ind. 579; Edwards v. Davenport, 20 Fed. 756; Chippen v. Chappel, (Kan. Sup.) 11 Pac. 453; 3 Pom. Eq. Jur. § 1419. In coming, to. this ¡.conclusion, I am not unmindful of the fact that greater care could have been used in framing the complaint, so as to bring the remedy sought more clearly within, equitable rules governing., such procedure.
While counsel ¡for-the-respondents have presented in their brief an able-discussion-, of the law involved in this controversy, which. the- court: duly, appreciates, yet this overpowering equity presented-Imthe claim of the appellant impels me to the c o nel úsi'ó ner e a oh éd. But my associates, while agreeing with ¡the.'writér:ofrthis opinion upon the first and second propositions.-laid--down.therein, and with reference to the application..of-the-.statute of limitations- thereto,when the same'- was not ;plékdéd;únd that the order and decree sustaining'',the'.demurrereand-dismissing the complaint should be set aside-, andiivacate'd,and that a new trial be allowed, disagree with ¡the,: writer, of this opinion in so far as the opinion holds that- the-statute of limitations as to the lien obtained by the.-payment of the notes secured by the mortgage to Mrs. Léakér .began to run at the time of such payment. The majority of the court are of the opinion that the plaintiff secured -the *99right by-the payment; to be .-subrogated to Mrs. Leaker’s lien by virtue of the mortgage, and that the statute of limitations, as to that mortgage, began to run when the notes secured by the mortgage became due. It is therefore ordered that the decision in the case be reversed, and the cau'se -remanded, -with directions to the trial court to vacate and set aside the judgment and decree herein, and to grant; a ne.w trial, with, posts,.and, if desired, allow the parties an opportunity to amend their pleadings in accordance with right and-justice, . .
ZaNE, C. J., and Bartgh; J. We concur in the opinion, with tb.0 exception referred to-therein..