Plaintiff, appellee here, brought as trustee or agent for four creditors of the defendant and appellant Waldron, an action in equity for the foreclosure of a chattel mortgage given by appellant, and the application of the proceeds of the sale of the personal property mortgaged, to the payment pro rata of the indebtedness due to the several creditors of the appellant as aforesaid.
Prom the record it appears that the defendant Waldron was indebted to the four creditors mentioned, for whom and in whose behalf it is alleged the action is brought by plaintiff, as trustee, for sums aggregating over $3,000; one J. H. McKinnon being liable for the payment of such indebtedness as surety on the instruments evidencing the same. During the existence of the said indebtedness, and some time prior to the institution of the present proceedings, the said Waldron executed his certain note for $1,000, and the chattel mortgage securing the same, which is now in controversy, which it is alleged in the petition was given for the purpose of indemnifying McKinnon for becoming surety on the notes evidencing the principal indebtedness to the several parties mentioned, and that said thousand dollar note and the chattel mortgage securing the same was by said McKinnon, for a valuable consideration, assigned and transferred to the plaintiff, as trustee, on behalf *691and for tlie benefit of said creditors of Waldron. On the thousand dollar note which the mortgage in controversy secures appears the following indorsement: “This note is given to secure Joseph McKinnon against loss as surety on notes now outstanding or that he may hereafter sign as surety (secured by mtg.) (signed) J. H. McKinnon.”
The assignment of the note and mortgage to plaintiff is as follows: “For value received, I hereby sell, assign, transfer and set over unto N. H. Meeker as the legal agent and trustee of the First National Bank of Greenwood, and Mr. L. 0. Sterling, Carolina Finlay and Gertrude Cutler, the within mortgage and notes accompanying the same and authorize him to collect and discharge the same.”
It is also alleged that the principal debtor and his surety are insolvent and have been for more than a year past. It is prayed that a decree may be entered foreclosing the mortgage, fixing the time and place and manner of sale of the mortgaged property and that the proceeds arising from the sale may be applied pro rata on the respective debts due the several creditors for whom the plaintiff was acting. Waldron answered and after issues were formed a trial was had resulting in findings in favor of the plaintiff and granting to him the relief prayed. There is no serious contradiction dr conflict in the evidence and the matters presented to us by the appeal are largely questions of law rather than of fact. The trial court found the several amounts due the creditors of Waldron, specifying the same and to whom due, for the satisfaction of which the plaintiff brought the action as trustee; also the execution and delivery to McKinnon of the note and mortgage made the basis of the equitable action; that they were executed for the purpose of indemnifying him as surety on the four several notes evidencing the indebtedness mentioned and for the purpose of securing payment of said notes; that the said mortgage and the note accompanying the same were assigned and transferred by McKinnon to the plaintiff as trustee in behalf of and for the benefit of the four several creditors; that no part of the sum secured *692thereby had been paid and that by its terms and conditions there was owing to the plaintiff as trustee from the maker thereof $1,000; and that the mortgage was a valid lien on the property described therein which was ordered advertised and sold as upon execution and the proceeds thereof applied after the payment of the costs of action, pro rata, on the indebtedness found due the respective creditors for whom the plaintiff was acting as trustee.
It is contended by counsel for appellant, defendant below, (i) that the plaintiff can not maintain the action; that he is a self-constituted trustee or agent without authority to prosecute the action, which should be brought and maintained by the real parties in- interest, that is, the creditors of the defendant Waldron; (2) that the note and mortgage was given to indemnify the surety McKinnon personally, and until he lias suffered some loss no right of action has accrued thereon and that in no event can the creditors of the defendant maintain the action when no payment’has been made or loss suffered by the mortgagee to whom it was given as indemnity; (3) that an action in equity to foreclose a chattel mortgage will not lie under the stipulation of the mortgage, the ^ statutory method of foreclosure by notice and sale being exclusive; (4) it is also contended that the note evidencing the indebtedness to the First National Bank was given -subsequent to the execution of the note and mortgage in controversy which, under no view of the case, could be considered as collateral security for such indebtedness.
In respect of the contention that the plaintiff is not the real party in interest and can not, therefore, maintain an action on the instruments under which he claims relief, it appears from the assignment to him heretofore quoted that he is the legal holder thereof as trustee or agent of the creditors of the mortgagee. The assignment conveys or purports to convey to him in the capacity mentioned all the title, right and interest of the assignor and authorizes Mm to proceed and collect the sum due thereunder as fully and effectually as might be done by the mortgagee *693and payee were it not for the transfer of title and interest by virtue of the assignment.
It is quite true that the creditors have the beneficial interest in the note and mortgage, assuming they were given to secure the indebtedness owing by Waldron to them, but will this prevent the legal holder from maintaining an action without joining the beneficiaries as plaintiffs, or must they bring an action alone and without regard to the plaintiff’s rights by virtue of a legal and valid assignment to him for the purpose stated? We incline to the view that this question has already been answered in plaintiff’s favor by the prior decisions of this court. Section 32 of the Code of Civil Procedure provides that a person with whom or in Avhose name a contract is made for the benefit of another may bring an action without joining with him the person for Avhose benefit it is prosecuted.
In Stoll v. Sheldon, 13 Nebr., 207, it is held that when a promissory note is made to an agent in his own name as promisee, he may maintain an action thereon without joining the person beneficially interested in the note. Says the court: “The Code requires an action to be brought in the name of the real party in interest, but excepts trustees. of express trusts, executors and administrators, and persons in whose names contracts are made for the benefit of others. Judge Bliss has referred to the cases bearing upon this question. See sec. 57 Code Pleading, and Pomeroy more fully in Remedies and Remedial Rights, secs. 171-182. The laAV seems to be definitely settled by the decisions referred to, that when a contract is entered into Avith- an agent in his own name, the promise being made directly to him, he may maintain an action on such contract in his own name without joining the person beneficially interested..”
In an IoAva case, under a section of the Code quite similar to our oavu, it is held by the supreme court of that state that “the party holding the legal title to a cause of action, though he be a mere agent or trustee-with no beneficial interest therein, may sue thereon in his OAvn name.” Cas*694sidy v. Woodward, 77 Ia., 354. Says the court, after setting forth the provisions of their Code, which are very similar to ours: “It has uniformly been held by this court that, under this provision of the Code, the party holding the legal title to a cause of action, though he be a mere agent or trustee, with no beneficial interest therein, may sue thereon in his own name,” citing a number of prior decisions. Of the same import are Wetmore v. Hegeman, 88 N. Y., 69, and Lundberg v. Northwestern Elevator Co., 42 Minn., 37. The plaintiff was the holder of the legal title of the note and mortgage on which the action is grounded. The contract was made in his name as agent or trustee, and his right to maintain an action in his own name is authorized by the section of the Code referred to.
The second contention is that, under the agreement of the parties to the note and mortgage in controversy, it was available only to McKinnon in case he sustained actual loss by reason of his becoming and being surety for Waldron, and that it was not a chose in action which could be assigned by McKinnon, and a cause of action arise thereon in favor of the assignee, and in no event could a cause accrue until after McKinnon had paid all or part of the indebtedness for which he was surety. It is pleaded in the petition and supported by the evidence that both the principal and surety on the original indebtedness were wholly insolvent and had been for some time. This, in our judgment, would constitute ample equitable grounds to justify a court of equity in directing the collateral security to be sold and the proceeds applied on the principal indebtedness. Under well settled and recognized principles of equity it seems quite clear that the lien of the mortgage on this property is ultimately for the benefit of the holders of the original indebtedness, who, in a proper case, should be adjudged entitled to subrogation to the rights of the surety. When the surety is insolvent, as in this case, or for failure otherwise to discharge the legal obligation he had assumed, it would seem the equitable principle of subrogation could be in-*695voted. The object and purpose of the chattel mortgage to be finally accomplished was to secure payment of the principal indebtedness by the mortgagor, who was primarily liable therefor. It was his obligation, and to secure its satisfaction out of his own means as the one on whom the obligation first rested, he entered into the contract with his surety whereby the mortgage was executed so that in case he did not satisfy the debt and the surety was compelled to, recourse could be had to the collateral security. The payment by the surety of the debt would not cancel it as to the principal debtor, who yet would remain liable for its satisfaction out of his own property. Had the principal creditors possessed collateral security and the personal surety had paid the indebtedness it would hardly be doubted that he would be entitled to be subrogated to the rights of the creditors to such collateral security; and on a parity of reasoning, we can see no difference in principle as to the right of the principal creditors to be subrogated to the rights of the surety upon his inability or failure to respond to his obligation.
This court has held in Richards v. Yoder, 10 Nebr., 429, that “Where a surety for the payment of a debt receives a security for his indemnity and to discharge such indebtedness, the principal creditor is in equity entitled to the full benefit of that security.” Chancellor Walworth in Curtis v. Tyler, 9 Pai. Ch. [N. Y.], 431, 435, states the principle as follows: “It is well settled, however, that where a surety, or a person standing in the situation of a surety for the payment of a debt, receives a security for his indemnity and to discharge such indebtedness, the principal creditor is in equity entitled to the full benefit of that security. And it makes no difference that such principal creditor did not act upon the credit of «uch security in the first instance, or even know of its existence.”
Minshall, J., in the case of Pendery v. Allen, 19 L. R. A. [Ohio], 367, 370, uses the following language: “It is a well-settled rule in equity that where a surety, for his own indemnity, takes a collateral security from his prin*696cipal, such security is regarded, in equity, as a trust for the better security of the debt, and chancery will compel the execution of the trust for the benefit of the creditor,” citing Vail v. Foster, 4 N. Y., 312; Kelly v. Herrick, 131 Mass., 373; Green v. Dodge, 6 Ohio, 80; Eastman v. Foster, 8 Met. [Mass.], 19; Paris v. Hulett, 26 Vt., 308; Chamberlain v. St. Paul & S. C. R. Co., 92 U. S., 299, 23 L. Ed., 715; Heath v. Hand, 1 Pai. Ch. [N. Y.], 329.
From the foregoing, we think it must be regarded as conclusive that the trial court was warranted in treating the principal creditors as entitled to subrogation to the rights of the surety in the collateral security he possessed, and especially so in view of the assignment to the plaintiff of all the interest and title of the surety in and to the property mortgaged for the purpose of having the proceeds applied in satisfaction of the principal indebtedness.
It is next contended that the trial court had not jurisdiction to entertain the action and decree a foreclosure of the chattel mortgage Avhen the parties thereto had stipulated in the instrument as to the method of foreclosure by advertisement and public sale in the manner authorized by statute. The contention is not, in our judgment, tenable. The statutory method of advertisement and sale is not exclusive even though the parties stipulate in the mortgage for the foreclosure of the mortgagor’s equity of redemption in that manner. It is the law in this state in respect to personal property mortgaged or pledged as security for the payment of a debt that the legal title to the property remains in the mortgagor until divested by foreclosure proceedings and sale as provided by law and that until the title is so divested the mortgagee acquires and has only a lien thereon. Bedford v. Van Cott, 42 Nebr., 229; Musser v. King, 40 Nebr., 892; Murray v. Loushman, 47 Nebr., 256. Equity courts are especially vested Avith jurisdiction in matters pertaining to the adjudication of the rights of parties in respect of liens and conflicting interests arising therefrom upon property both real or personal. In the present controversy there were involved questions appeal*697ing peculiarly to a court of equity and the action could, we think, be rightfully maintained as an action in equity for the purpose for which it was instituted. It is the right, says the chancery court of New Jersey, for a mortgagee to foreclose his mortgage in equity. He is not bound to incur the risk of selling the property without the sanction of a decree. Freeman v. Freeman, 17 N. J. Eq., 44.
A mortgagee of chattels may either resort to a court of equity to compel a redemption or to foreclose the mortgagor’s right to redeem or he may obtain the same object by a fair sale of the property after due notice to the mortgagor. Wilson v. Brannan, 27 Cal., 258, 270; Rich v. Milk, 20 Barb. [N. Y.], 619. The power of sale contained in a mortgage of chattels does not preclude the mortgagee from proceeding in equity to foreclose the mortgage. Bennett v. Reef, 16 Colo., 431. The fact that there is a power of sale in a chattel mortgage does not affect the right to foreclose it by action. Forepaugh v. Pryor, 30 Minn., 35, and authorities therein cited.
Our attention is also called to the fact that of the notes evidencing the principal indebtedness the one in favor of the First National Bank of Greenwood was executed subsequent to'the time the mortgage indemnifying the surety was given and for that reason it is insisted the mortgaged property can not be held as collateral security for the indebtedness represented thereby. But it is entirely clear .from the evidence that the indebtedness was existing at the time and was intended to be secured to the same extent and the mortgage given for the same purpose as that of the indebtedness of the other three creditors mentioned. The fact that a new note had been given to evidence the same debt would not change the respective rights of the parties with relation to. the collateral security; and the trial court rightly included this particular item of indebtedness with the others mentioned, as resting on an equality and entitled to share in the proceeds of the sale of the collateral security.
We arrive at the conclusion that the decree appealed *698from was entered in conformity with law and principles of equity and should therefore be affirmed, which is accordingly done.
Affirmed.