Bartholomew, C. J.
This is an action brought to compel the beneficiaries under a trust deed to return certain money received by them from the trust estate, to the end that the same may be applied in payment of certain liabilities incurred in the execution of the trust. On a trial to the court the plaintiff succeeded, and the defendants appeal, and ask a retrial of the entire case. This controversy, in a somewhat different form, was before us in Mercantile Co. v. Grover, 7 N. D. 460, 75 N. W. Rep. 911. The plaintiff sold goods to the trustee named in a trust deed, and has not received pay therefor. In the former action he sought to recover against these defendants and others, who are beneficiaries under the deed, upon the ground that they were in fact partners in conducting the trust business, and the trustee was their agent in purchasing the goods. This position was held by this court to be unsound, but in answering the contention of counsel that, if the plaintiff failed in that case, it was without remedy, we said that the trustee became personally liable on every contract made by him in the discharge of his trust. We also said: “It is true that the trustee may claim reimbursement from the funds in his hands for any proper expenditure made by him in the execution of the trust, and this equity is the foundation of the right of the creditor, under peculiar circumstances, to proceed directly against the trust property itself. See Hewitt v. Phelps, 105 U. S. 393, 26 L. Ed. 1072; Clopton v. Gholson, 53 Miss. 466; Norton v. Phelps, 54 Miss. 471; In re Johnson, 15 Ch. Div. 548; Dowse v. Gorton, 40 Ch. Div. 536; Mason v. Pomeroy, 151 Mass. 164, 167, 24 N. E. Rep. 202, 7 L. R. A. 771.” And again we said: “Of course, the parties may agree that the trustee shall not be held personally on the contract, but that only the trust estate itself shall be chargeable with the debt. In such a case, if the instrument creating the trust authorizes this to be done, or even when it does not give such authority, if the circumstances are peculiar, the trustee is not bound, but the fund is. New v. Nicol, 73 N. Y. 127; Gill v. Carmine, 55 Md. 339, 342, 343.” And still further, in speaking of the trustee, we said: “And if he should distribute the estate, leaving *523unpaid any of the debts incurred by him in the execution of the trust, we have no doubt that a court of chancery would subrogate the creditors to his equity, and allow them to follow, in the hands of those who had received the property, the portion of the assets which had been -paid to them by the trustee. And even while the trust property is still in the hands of the trustee, those who had dealt with the trustee as such might, under special circumstances, obtain a decree impressing upon such property an equitable lien in their behalf. See cases first above cited.” Plaintiff in this action seeks to bring itself within some or all of these conditions. We restate a portion of the facts: One Grover, a general merchant doing business at Horace, in Cass county, became financially embarrassed. His property was incumbered by liens. He entered into an arrangement with creditors for an extension of time. In pursuance of such arrangement, he made a trust deed of all of his property to one Jones. The deed was executed by Grover as trustor, and Jones as trustee, and the creditors as beneficiaries under the trust. The trust deed contains the following language: “Said party of the second part shall take possession of said property and business of the said party of the first part, and shall sell, dispose of, and convert said property, and the good will of said business, into money, by and through said party of the first part, or such other person or persons as said party of the second part shall designate and appoint for that purpose, and in such manner and at such time or times as, in the judgment of the said party of the second part, will produce the most money; and that the net proceeds thereof, after payment of all costs and expenses of executing the trusts hereby established, shall be distributed among said creditors in the manner following, to-wit.” Then follow provisions for pro rata distribution among secured creditors, and, when their claims are satisfied, then among unsecured creditors. We then find the following provision: “The said party of the second part shall have power to continue said general merchandise business and to sell the stock of general merchandise at private sale, and in the usual course of trade, and to replenish said stock of merchandise with such articles of staple g-oods as may be necessary to successfully continue said business; and such power shall continue so long as said party of the second part shall be of the opinion that the interests of said creditors will be best subserved by that method of executing said trust.” The complaint in this action, after all necessary formal allegations, including the execution of the trust deed and the entry of the trustee upon his duties thereunder, alleges that said trustee applied to plaintiff to purchase certain staple goods to replenish said stock of general merchandise, and agreed that for goods so purchased he would pay plaintiff in the ordinary course of business out of the proceeds of said trust property, and that under such agreement plaintiff sold and delivered to such trustee staple goods and merchandise to replenish said stock in the amount of $1,292.85, and that a balance of $532.65, and interest from February 1, 1896, remains due and unpaid on said account. It also alleges that all of said trust estate has been exhausted, and the *524trust closed, and a large amount of money arising from said trust estate distributed by said trustee to these defendants. It also alleges the insolvency 'of said trustee, and that he has no funds of said estate from which to pay the claim of plaintiff. Several of the defendants filed separate answers, but 'their' general purport is the same, and consists of a denial of the special allegations of the complaint already referred to, and particularly denies that the trust estate has been closed out, and the trust terminated, and denies the insolvency of the trustee, alleges that he is indebted to the trust estate, and that judgment had loeen obtained against him. One answer also pleads the former judgment as an adjudication. It is also answered that at the time these defendants received their last dividend there was owing to plaintiff from the estate only the sum of $234.82. One of the defendants demurred to the complaint upon the ground that it did not state facts sufficient to constitute a cause of action, and because it showed a defect of parties defendant. Objections to the introduction of evidence under the complaint were made for the same reasons, and we therefore first notice these points.
There is no merit whatever in the objection that the complaint shows a defect of parties. True, the trust deed discloses that there were many other creditors of Grover; but they were unsecured creditors, and have received nothing on their claims.' The theory of this action is that these defendants have received money from the proceeds of the trust property which they cannot, in equity, withhold from this plaintiff. Of course, no such claim can exist against one who never has received anything from the trust property. And here it is germane to remark that the defense of former adjudication cannot prevail. As we have seen, the former action was brought against all the creditors of Grover on the theory of a partnership under the trust deed. The issues here raised were not, and could not have been, litigated in that case.
The complaint states a cause of action. True, it does not appear that these defendants ever assented to this particular purchase from plaintiff, but this is not an ordinary trust created by will or the act of the trustor and trustee alone. The beneficiaries expressly agreed to all the terms of that deed. They gave the trustee unlimited discretion in replenishing that stock of merchandise, and they, in terms, agreed that only the net proceeds of the estate, after 'paying all costs and expenses of executing the trust, should bo distributed to them; and counsel concede that the purchase price of these goods received from plaintiffs coirstitutes a part of the expenses of executing the trust. We think the complaint also sets forth the particular grounds which relieve it from looking exclusively to the primary liability of the trustee. It alleges that he has no trust property in his hands, and that he is insolvent. It alleges that the goods for which payment is sought were sold and delivered to him as such trustee. We think this raises a presumption that the estate received the benefit of the goods. In that event, had he paid for the goods, he might have reimbursed himself before any distribution to the *525beneficiaries. Nor was it necessary, as a matter of pleading, for the plaintiff to state the account between the estate and the trustee, in order to show that the trustee was not indebted to the estate, and so barred from reimbursing himself for expenditures from the trust estate. If the trustee was so indebted, that fact was matter of defense. It has been so pleaded by the answering defendants. The general principles which control in cases of this character are well stated in Norton v. Phelps, 54 Miss. 467-471, as follows: “The principle is that, while persons dealing as creditors with the trustee must look to him personally, and not to the trust estate, yet where the estate has received the benefit of expenditures procured to be made for it by the trustee, and it has not in any way borne the burden of these expenditures properly chargeable to it, and to fasten the charge upon it will do it no wrong, but simply cause it to pay for what it is liable to the trustee, or would be liable' if he had paid it or should pay it, and because of the insolvency or nonresidence of the trustee our tribunals cannot afford the creditor a remedy for his demand, he may proceed directly against the trust estate, and assert against it the demand the trustee could maintain if he had paid or should pay the claim, and should himself proceed against the trust estate.” It is true that this case, being subsequently transferred to the federal courts, the Supreme Court, in 105 U. S. 393, 26 L. Ed. 1072, decided the case differently; but the principle above quoted was expressly approved, and the Federal Supreme Court said: “The ground and reason for this rule is that the trustee has an equity of his own for reimbursement for all the necessary expenses to which he has been put in the administration of his trust, which he can enforce by means of the legal title to the trust estate vested in him; and that his creditor, in the cases supposed of his insolvency or absence from the jurisdiction, may resort to the equity of the trustee upon a principle of equitable substitution or attachment, for his own security.” In Mason v. Pomeroy, 131 Mass. 167, 24 N. E. Rep. 203, 7 L. R. A. 773, it is said: “That is to say, where trustees who are authorized to carry on a business contract debts, they are not only liable personally for the payment of them, but the creditors may also resort to the trust fund, subject, however, to the rules of equity, as applicable to the facts and circumstances which may exist in any particular case. Ex parte Garland, 10 Ves. 110; Ex parte Richardson, 3 Madd. 138; Owen v. Delamere, L. R. 15 Eq. 134; Cutbush v. Cutbush, 1 Beav. 184; Thompson v. Andrews, 1 Mylne & K. 116; Burwell v. Mandeville, 2 How. 560, 11 L. Ed. 378; Smith v. Ayer, 101 U. S. 320, 330, 25 L. Ed. 955; Jones v. Walker, 103 U. S. 444, 26 L. Ed. 404; Pitkin v. Pitkin, 7 Conn. 307; Lewin, Trusts (7th Ed.) 217. It is, indeed, contended on the part of the plaintiffs that their right to resort to the trust property is a primary and original right, which exists independently of any right on the part of the trustee to be indemnified. Wylly v. Collins, 9 Ga. 223. The view, however, which has prevailed in England, so far as the question has been discussed, is that the creditors may reach the trust property when the trustees are entitled to be indemnified therefrom. *526and that the creditors reach it by being substituted for the trustees, and standing in their place. In re Johnson, 15 Ch. Div. 548; Dowse v. Gorton, 40 Ch. Div. 536.” Under these authorities it is clear that plaintiff was entitled to recover in this case, unless the trustee was so far indebted to the estate that he would have had no right of recovery had he paid plaintiff’s claim. We see no reason, and none has been suggested, why these principles should not apply after the distribution of the estate as well as prior thereto. In Norton v. Phelps, supra, the entire trust estate had been turned over to the beneficiary. In the case at bar the beneficiaries, by their express contract, agreed that they should receive only the net proceeds of the trust estate after payment of all expenses of executing the trust. If they have received the proceeds of the estate in violation of this contract, we know of no principle of equity that will permit them to retain such proceeds. Clearly, the complaint was sufficient upon this ground alone.
Plaintiff also sought to allege that by the contract between itself and the trustee the goods were sold in the exclusive reliance upon the trust estate, and that by such contract the trustee incurred no liability. The principle seems to be clearly recognized that under a contract of that character the creditor may proceed directly against the trust estate. Gill v. Carmine, 55 Md. 339; New v. Nicoll, 73 N. Y. 127. We express no opinion as to the sufficiency of the complaint upon this last point, or upon the proof under these allegations. The trial court evidently decided the case upon this theory; but, without intimating that the court was wrong in so deciding, we prefer to place our decision upon a more certain ground, but one that was not open to the trial court. Before this case was tried in the District Court, the case of Scott v. Jones had been tried in the same court, and judgment rendered against the defendant for the sum of $1,000. In that case Scott represented the trust estate here involved, and the defendant Jones was the trustee here involved, and that action was brought to' compel an accounting by the trustee. On the trial of this case the judgment in that case was admitted, which, of course, showed the trustee indebted to the estate. It followed that, under the authorities first above cited, had the trustee paid plaintiff’s claim, he would have had no equity that would have permitted him to reimburse himself from the trust estate, because he was already indebted to that estate, and hence he had no equity to which this plaintiff could be subrogated. But Jones appealed from the judgment against him in the District Court, and at this term of this court we reversed that judgment, and dismissed the action as against Jones. See Scott v. Jones, 9 N. D. 551, 84 N. W. Rep. 479. The judgment in that case establishes the fact that the trustee is not and was not indebted to the estate. Section 5713d, Rev. Codes, requires this court not only to take judicial notice of its own judgments and records, but also of the fact that the case now before the court has connection with the one formerly decided by it. .The case is here for trial de novo. We must try it upon the record before us and upon the facts, of which we must take judicial notice. We conclude, as did the *527trial court, that the trust is closed, and the estate exhausted. There is no undistributed trust property. The trustee is insolvent. Unless the defendants are required to return funds received from the trust estate contrary to the terms of their contract, plaintiff is without remedy. The defendants are clearly liable. But they urge that in no event can they be held liable to the extent adjudged by the District Court, and for this reason: It is undisputed that a portion of the goods the purchase price of which plaintiff seeks to recover were delivered to the trustee after the payment by the trustee to the beneficiaries of the last dividend, and defendants contend that they cannot be held for expenses incurred subsequent to the payment of any dividend. We think that is not sound, although we find no express authority. The goods went into the trust estate, and augmented the estate by that much. They were undoubtedly absorbed in paying expenses growing out of the business. At the time the last dividend was paid, it is clear from the statement of the trustee then made that he supposed he was retaining ample in his hands to pay all expenses that had been or might be incurred. In that he was in error. He did not realize from the property as anticipated. If, under these circumstances, he had paid plaintiff’s claim, and found himself without trust property from which to reimburse the outlay, we think in equity he could call upon these beneficiaries to reimburse him from dividends received. If the trustee had that equity, then, on principles already discussed, this plaintiff is subrogated thereto. The judgment of the District Court is affirmed.
(84 N. W. Rep. 379.)
All concur.