We adopt as a concise statement of the issues the substantial averments of the pleadings as presented by the appellee in his argument:
On the 19th day of April, 1911, one George A. Netcott, a contractor and builder, entered into a contract with W. P. Crumpacker, superintendent of the Independence State Hospital at Independence, Iowa, for the erection of a certain building. On the same day the said George A. Netcott gave to the *20said W. P. Crumpacker, as such superintendent, a bond, in the penal sum of $1,000, with I. C. Plane and Jacob Wackerbarth as sureties. The said bond was conditioned, among other things, on the prompt payment of all just demands of all persons supplying labor or materials in the prosecution of the work contemplated in the said contract. George A. Netcott proceeded to erect the building provided for in the contract, and on or about July 21, 1911, he purchased from the Des Moines Bridge & Iron Works certain materials to the amount of $94.50, which materials were delivered and used in the erection of the said building. Netcott failed to pay for said materials, and on October 3,1911, before the said building was completed, he made a general assignment, for the benefit of his creditors, to W. E. Bain, the appellee herein, who took charge of the work and completed the building, paying for the necessary materials and labor. After the building was completed and accepted by W. P. Crumpacker, superintendent, the assignee, Bain, received a warrant for about $2,000, the balance due upon the completion of the building.
On November 3, 1911, the Des Moines Bridge & Iron Works began an action in the district court of Buchanan county, Iowa, to enforce the collection of its claim, making George A. Netcott, I. C. Plane, Jacob Wackerbarth, and W. E. Bain, assignee, defendants, and asking a personal judgment against all of the defendants, except W. E. Bain. On November 13, 1911, I. C. Plane and Jacob Wackerbarth filed an answer and cross-petition. In the answer defendants admitted the execution of the bond and the assignment to W. E. Bain, but demanded proof as to the claim. In the cross-petition they alleged the execution of the contract, the bond, and the assignment to Mr. Bain. They alleged that Mr. Bain had completed the building, and had collected the balance, about $2,000, due Netcott under the terms of the contract, and that he now had either the money or a warrant on the state treasury for the same. That at the time of the assignment, Netcott had several other contracts for the erection of certain buildings which were but partly completed, and that he was owing for materials and labor furnished for the other buildings and also many personal claims, in addition to what he was owing for materials and labor for the particular building for which this bond was given. Appellants therefore prayed: That as to the plaintiff, judgment be rendered against them as sureties only, and that they be subrogated to all rights of plaintiff against George A. *21Netcott and W. E. Bain, assignee. That as to their codefendant, W. E. Bain, assignee, they ask relief against him as follows : That he be required to segregate the amount of money received by him of W. P. Crumpacker and the state of Iowa, for the work done by his assignor, at the Hospital for the Insane at Independence, from the other funds in his hands, and that he be required, first, to pay all bills owing by said George A. Netcott for materials furnished, or labor performed on said job, including the claim of the plaintiff, before mixing said fund with other funds for general distribution among creditors, and that it be adjudged, further, that all claims for material or labor that these defendants have to pay for in consequence of their liability, as sureties for said George A. Netcott, be declared to have a prior right of satisfaction out of the fund in the hands of the assignee, and that they have such other and further relief as equity and good conscience requires and for costs of suit. W. E. Bain, assignee, demurred to the cross-petition on the grounds that the facts stated therein did not entitle the appellants to the relief demanded. On February 23, 1912, judgment was rendered against I. C. Plane and Jacob Wackerbarth, as sureties, for the amount of plaintiff’s claim. On September 24, 1912, the demurrer of appellee to the cross-petition was sustained, and the appeal is from the ruling on the demurrer.
II. By this record is presented the question whether sureties on a building contractor’s bond, who have become liable on their obligation to a dealer who furnished material which was used in the construction of the building, are entitled to a preference over general creditors against the fund in the hand of the builders’ assignee for the benefit of creditors.
Certain legal propositions advanced by appellants are conceded by the appellee to be correct, and we state them, without discussion, for the application they may have in the further consideration of the case. They are:
1. After a debt becomes due the party liable therefor as surety may resort to chancery to compel the principal to exonerate him by the payment of the debt.
2. Sureties can sustain a bill to have their debt paid by *22the principal, or .out of his estate, before they have been compelled to pay the debt.
3. And this, whether the surety has been sued or not'
4. A surety is entitled to have the principal’s property applied on the indebtedness for his relief.
5. The assignee stands in the shoes of the insolvent in respect to liability on contracts made by him.
1. PUBLIC BUILDING : rigts of material men. III. The demurrer having conceded that the materials which were furnished by the Des Moines Bridge & Iron Works entered into the construction of the building, the bridge eompany therefore had the right of a material-man, an<^ while under Code, Section 3102, it was not entitled to a lien upon the building or improvements, nor to a lien upon the fund, it with other labor and materialmen became entitled to a preference as against general creditors, if timely action was taken to assert such right. Whitehouse v. Am. Surety Co., 117 Iowa, 333.
2. SAME : priorities : determination. The right thus recognized is purely equitable, and not enforceable in proceedings at law. When, as is alleged in the petition and admitted by the demurrer, a fund derived from a building contract is in the hands of an assignee for the benefit of creditors gen- , ,. . . eraiiy, and by a proper proceeding m equity the fund and the necessary parties are before the court, and no rights save those of the assignee have intervened, the claims and priorities as to the particular fund may be determined and adjusted.
We have held, in Wackerbarth v. School District, 157 Iowa, 614, that an assignee of an insolvent takes the property subject to all equities, liens, and incumbrances existing against the same in the hands of the insolvent. To the same effect, see, Roberts v. Corbin, 26 Iowa, 315; Warner v. Jameson, 52 Iowa, 70; Merwin v. Austin, 58 Conn. 22, (18 Atl. 1029, 7 L. R. A. 84). No question being raised under the pleadings that the action of the appellants is not timely, it would follow that the bridge company as materialmen, were it so asking, would have the *23right, as against general creditors of the insolvent contractor, to have its claim established as a preferred one. This, of course, would not conclude the question, as there would generally be for determination the further one of priority rights among the different preferred creditors; but we cannot regard this latter phase as entering into the present ease, as the prayer of the appellants is only for priority against general creditors, and for general equitable relief.
3.SAME : rights of sureties on contractors bond. IY. This right of. preference being in the bridge company, it must then be determined whether as sureties on the contractor’s bond, and against whom in this proceeding judgment was entered on the bond for material furbished by the bridge company to the insolvent, the appellants will succeed to the preference right which under the law was in the material-man, this obligee. Contracts of suretyship and the rights of a surety are treated with favor in the law, but not to the extent of enlarging the terms of the obligation, nor as affecting intervening and superior claims. As between the principal and surety there is created by the law the implied contract that the surety will be held harmless, and courts of equity will so far enforce this implied obligation as to grant relief to the surety as against all who have not superior rights under the contract or arising out of the undertaking the performance of which was guaranteed by the surety. Bellamy v. Cathcart, 72 Iowa, 207. It having been conceded by the appellee as a general rule, and which we think is correct, that the surety may maintain a bill in equity to have the claim paid by the principal out of his estate, and before the surety has been compelled to pay it, it would follow, as a natural and just conclusion, that the same right must exist as against the trustee or assignee of the contractor, who holds the particular funds, against which as we have held in Wackerbarth v. School Twp., supra, the equitable claim may be established. Glenn v. Doyle, 3 Tenn. Ch. 324; Town of Gastonia v. Construction Co., 131 N. C. 359, (42 S. E. 857); Merwin v. Austin, supra.
*244. SAME : rights of general contractors. Y. The conclusions reached have been without reference to the claim made by appellee in argument that counsel for appellant have assumed that there was a profit in the erection of the building, and that no funds of the contractor, derived from other sources, were used m its construction; and losing sight of the fact that the fund received by the assignee from the state, while a payment on the contract, may, by reason of other and different transactions or from the use of outside funds by the contractor or his assignee in completing the work, represent more than that properly applicable to the claims of preferred creditors against the building fund.
It will be noticed that the cross-petition upon which this appeal is based prays that the assignee be required to segregate the amount received by him for the Independence work from the other funds in his hands, and that all bills for material and labor on said contract be paid from the fund before it is used for general distribution. True, this prayer does not go to the limit of the suggestion made by the appellee, and require inquiry as to what part of said fund should properly be used to reimburse the estate due general creditors for outside funds which may have been used in this contract. From the pleadings it only appears that the payment by the state to the assignee was in settlement of the balance due under the particular contract. For the purpose of this hearing it can be treated in no other way, and held to be a fund in which the cross-petitioners have equitable rights superior to general creditors.
When tried upon its merits, inquiry as to the funds , which are subject to claims of preference will necessarily be made; but under this record the fund received by the assignee as final payment on the building contract must be treated as being subject to the equitable rights of labor claims and materialmen arising out of the construction.
There was error in sustaining the demurrer to the cross-petition. The judgment of the trial court is Reversed.
Weaver, C. J., and Deemer and Gaynor, JJ., concur.