
141 N.W.2d 491 (1966)
FIRST NATIONAL BANK OF ST. PAUL, Respondent,
v.
McHASCO ELECTRIC, INC., Defendant,
Fidelity & Casualty Company of New York, Appellant,
City of Duluth and Village of New Brighton, Respondents,
Village of Mound, Defendant.
No. 39598.
Supreme Court of Minnesota.
April 1, 1966.
*492 Richard J. Leonard and David M. Beadie, St. Paul, for appellant.
Frank Hammond and Richard H. Kyle, St. Paul, for First Nat. Bank of St. Paul.
Harry E. Weinberg, City Atty., D. Peter Rask, Asst. City Atty., Duluth, for City of Duluth.
Perry Copeland, Minneapolis, for Village of New Brighton.
Robert C. Kucera, Northfield, amicus curiae for Minn. Bankers Assn.
ROGOSHESKE, Justice.
This appeal from a judgment presents the question of the priority of claims to funds withheld by municipalities on construction contracts as between the surety for the contractor (which performed the contractor's obligation to pay claims for labor and materials) and a lender bank (which loaned money to the contractor to pay such claims upon a security assignment of the contractor's right to payment upon completion of the contracts). The trial court found in favor of the bank and the surety appeals.
McHasco Electric, Inc., (the contractor) entered into construction contracts in August and September 1959 to install street lighting facilities for the municipalities of Mound, New Brighton, and Duluth. Each of the contracts required the contractor to pay all claims for labor and material as a condition to receiving final payment. Each also contained provisions authorizing the municipalities to withhold a percentage of the progress payments due the contractor and to use such withheld funds for the payment of claims for labor and materials if the contractor neglected or failed to pay them. Fidelity & Casualty Company of New York (the surety) furnished performance bonds for the contractor *493 on each contract. Because the contracts involved public work, Minn.St. 574.26[1] required these bonds to render the contracts valid. The statute is designed to protect the municipality by insuring payment of claims for labor and materials "for the completion of the contract in accordance with its terms." Contemporaneously with the execution of the bonds in 1959, the contractor made a written assignment to the surety of all payments due the contractor. This assignment was effective, however, only "in the event of default" in the performance of the contracts.
During performance of these contracts, the contractor obtained loans of $7,900 and $7,300 on May 17, 1960, and June 8, 1960, from the First National Bank of St. Paul. As security for these loans, the contractor made written assignment of all payments due or to become due on the contracts. Apart from a payment of $4,699.10 on a construction contract which the contractor had with a municipality in Wisconsin and for which the surety had also issued a performance bond, 85 percent of the proceeds of the two loans were expended by the contractor between May 17 and July 11, 1960, for the purpose of paying labor and material claims arising out of the three contracts in question. This was in accordance with directions from the vice president of the bank who had negotiated the May 17 loan and was consistent with previous instructions given in connection with other prior loans made by the bank to the contractor. Another bank official handled the June 8 loan, and he neither gave such instructions nor placed any specific restrictions upon the use of the proceeds of that loan. The surety did not consent to the assignment and had no notice of the loans or the assignment. The physical work of the contracts, for our purposes, was completed, but the contractor was unable to satisfy the claims for labor and material, having ceased business on July 11, 1960, and being now defunct. The surety was forced to pay unpaid claims for labor and material amounting to $37,373.15. The contractor repaid only $1,500 of the $15,200 it borrowed from the bank; the unpaid principal, together with interest, owed to the bank at the time of trial amounted to $17,770.02.
As permitted by the construction contracts, each municipality withheld final payment of the balance due on its contract. Mound holds $2,248.75; New Brighton, $3,859.17; and Duluth, $11,045.07. Neither the municipalities nor the contractor make any claims to the $17,152.99 so withheld.
1. The surety claims a superior right to the funds under principles of subrogation previously applied to similar cases before this court. It cites as controlling National Surety Co. v. Berggren, 126 Minn. 188, 148 N.W. 55. The bank, claiming it has a prior right, relies on Farmers State Bank of Madelia, Inc. v. Burns, 212 Minn. 455, 4 N.W.2d 330, 5 N.W.2d 589; the principles of unjust enrichment; and our accounts receivable statute, Minn.St. 521.02.
In the Berggren case, we held that a surety in this situation prevailed over the assignee of a bank which was under no legal obligation to loan money. We there applied the reasoning of two United States *494 Supreme Court cases[2] that (126 Minn. 192, 148 N.W. 56) 
"* * * the equity of the surety who had been compelled to pay and had paid claims against the principal was superior to that of one who loaned money to the contractor to be by him used as he saw fit, either in the performance of his contract or in any other way."
The only feature distinguishing the Berggren case from the one before us is that the proceeds of the loan in Berggren were not used by the contractor to pay the claims of laborers and materialmen.
Shortly after Berggren, the question of competing claims between a surety and an assignee of a contractor arose in New Amsterdam Cas. Co. v. Wurtz, 145 Minn. 438, 177 N.W. 664, and Ganley v. City of Pipestone, 154 Minn. 193, 191 N.W. 738.
In Wurtz, the bank prevailed because, according to the unchallenged findings of the trial court, it had an agreement with the contractor to advance funds as needed to pay for labor and materials in the construction of a school building. The court distinguished Berggren and other cases because of the absence of any such agreement. This obligation, it reasoned, made the bank more than a mere volunteer, and the payment of the funds advanced to preferred claimants had relieved the surety from its obligation to pay them.
Ganley v. City of Pipestone, supra, followed the holding in Wurtz and more lucidly expressed the governing principles underlying that case. After expressly declaring the evidence sufficient to sustain a finding of an agreement by the bank to advance needed funds, it was clearly declared that the surety prevails unless the bank is previously obligated to advance money for the express purpose of paying for labor and material and the funds advanced are in fact used solely in paying such claims for which the surety would have been liable. This rule was applied in subsequent cases before this court[3] and as the substantive law of Minnesota in Seaboard Surety Co. v. First Nat. Bank & Trust Co. (8 Cir.) 121 F.2d 288, where the cases were reviewed.
As we understand it, the bank's first major argument is that the subsequent case of Farmers State Bank of Madelia, Inc. v. Burns, supra, changed the law and stands for the proposition that the bank need not be under a prior obligation to advance funds in order to achieve superiority over the surety. We do not agree with that interpretation. In that case, action was brought by the bank against the city of Owatonna to recover a final payment due under a construction contract, which the city had withheld and most of which the city (not the surety under compulsion of the bond) had paid to laborers and materialmen. The bank, although under no obligation to do so, had advanced funds to pay laborers and materialmen on a previous street improvement contract in the village of Madelia and to pay such preferred claimants on the Owatonna contract. While the Owatonna job was in progress, to secure the indebtedness incurred on the Madelia contract and "any future advances" on the Owatonna job, the contractor assigned the Owatonna contract to the bank. The surety, which suffered a loss on the Madelia contract but none on the Owatonna contract, intervened, claiming the funds withheld by the latter city. Although the city had a right to withhold a portion of the contract price, unlike the construction contract in the case at bar, there was no provision *495 which required the contractor to pay all claims for labor and material as a condition of final payment. Because of the absence of that provision, the court (one judge dissenting), following American Surety Co. of New York v. Board of County Commrs., 77 Minn. 92, 79 N.W. 649, held that the city had no right to divert the funds withheld even though all laborers and materialmen were not paid, and thus the bank, as assignee, was entitled to the contractor's earnings. The view expressed by the dissent was that, notwithstanding the absence of an explicit provision in the construction contract requiring satisfaction of labor and material claims as a condition of final payment, the city had a right to pay such claims from funds withheld, and upon such payments, its rights were superior in equity to the bank, which advanced money as a volunteer. The majority opinion is not based on a determination that the bank possessed superior equities because of the use of the proceeds notwithstanding the voluntary nature of the bank's loan; rather, the crux of it is the distinction between a case where the contractor's duty to pay laborers and materialmen arises from his independent covenant with the surety and a case like Berggren where that obligation of the contractor is made a condition of full performance of the construction contract. After making that distinction, the majority explicitly followed American Surety Co. of New York v. Board of County Commrs., supra, which held that, absent such a condition, a municipality has no right to withhold payments to a contractor after completion even though all claims for labor and material are not paid. Although the surety was denied relief, there was no need to resolve the question of priority between the bank and the surety because the surety, having paid no claims on the Owatonna job, could establish no basis upon which to recoup its Madelia loss from funds properly owed the bank as assignee of the contractor. Clearly, the case does not change the rules applied in earlier decisions, where the bank prevailed, by making it unnecessary to prove some form of agreement to finance the contractor and to restrict the use of the funds advanced to the payment of laborers and materialmen.
We are not persuaded to modify our previous decisions by granting preference to the bank solely upon proof that the funds advanced were used to pay laborers and materialmen.
The bank, as assignee, takes no greater rights than the contractor would have had. By express contractual provisions, the municipalities reserved the right to withhold final payments until all claims were paid as well as the right to make good the contractor's default by direct payment of claims to labor and materialmen. These reserved rights are superior to the rights of the contractor or its assignee. Until such claims were paid, performance was incomplete and neither the contractor nor the assignee bank could compel final payment. The surety, in paying such claims, performed the contractor's obligation to the municipalities, thereby rendering the necessary performance requisite to compel final payment. Upon payment, the surety is not subrogated to the rights of the contractor because the contractor, by its assignment, has divested itself of its right to the withheld funds, and it is the bank, and not the surety, who is in the position of the contractor. Also, the surety, under its contract, is responsible only for loss to the municipalities and the laborers and materialmen, and not to the contractor whom it did not undertake to save harmless. Rather, in making payment, the surety acted under compulsion of the bond and thereby became subrogated to the rights of the laborers and materialmen and to the rights of the municipalities to withhold payment to insure completion of the contracts and to pay unpaid laborers and materialmen. Although our cases have spoken in terms of the surety's subrogation to the rights of laborers and materialmen, the majority of the courts appear to hold that priority more firmly rests upon subrogation to the rights of the municipality. *496 This reasoning avoids possible problems of priority of the claims of laborers and materialmen over the assignee-bank upon considerations of the time and manner of asserting and filing such claims.[4] Undoubtedly, the underlying reasoning which grants preference to the surety recognizes that the bank, in advancing funds to a contractor, is in a better position than the surety to protect itself from loss upon the contractor's default. Presumably, with knowledge of the existence of a surety agreement (which is required by statute to grant a preference to laborers and materialmen) and the municipality's right to withhold payment pending full performance, the bank can refuse the loan unless the surety consents, thereby insuring its priority. Seaboard Surety Co. v. First Nat. Bank & Trust Co., supra. It should be noted that prior decisions do indicate that the agreement must include a commitment by the bank to advance future funds as needed to finance the contractor through the job. While such a requirement (whether or not limited as to amount) is sufficient to protect the bank, we do not here hold that it is essential. We only hold that upon the record in this case the equity of the surety through subrogation is superior to the bank even though a substantial part of the loaned funds were used in the performance of the contracts.
By reference to the finding of the court that both loans were "made upon the understanding and agreement that the funds so loaned would be used for the purposes of the contract or contracts," the bank insists that the use of the proceeds of the loans was limited by agreement to paying laborers and materialmen. We do not agree because the evidence is not sufficient to support that finding. It is undisputed that no restrictions were placed on the use of the funds loaned on June 8, 1960. With respect to the first loan on May 17, 1960, the most favorable view of the testimony indicates a mere expectation that the proceeds would be used for payment of costs of materials and payroll, in keeping with instructions to do so and past dealings. The contractor made no promises to limit its use of all the funds loaned to payment of preferred claimants arising from the three contracts and, indeed, did not conform to the bank's expectations. No effort was made by the bank to ascertain its use of the funds. The conclusion seems inescapable that the proceeds of both loans could be used either in the performance of any construction contract or in any other way the contractor saw fit. Moreover, there is nothing to indicate that the bank made any loan in reliance upon its right to the withheld funds should the contractor default, since it neither notified the municipalities nor the surety. Rather, pursuing its business purpose, the bank chose to make the loans in sole reliance upon the contractor's ability to complete performance.
2. The equities of the bank thus must rest upon the use of the funds which, without doubt, benefited the surety to the extent that the proceeds of the loan were in fact used to relieve the surety of a substantial part of its contractual obligation. The bank's second major argument is that to allow recovery by the surety would result in unjust enrichment. This argument has been frequently advanced in cases where the proceeds of the loan are traceable. In the few cases where it has been accepted,[5] the decisions have provoked criticism.[6] Numerous cases have considered the argument and rejected *497 it.[7] They are essentially based upon the claim of the surety that it is subrogated to the owner's position or that it also has paid for labor and materials and that the equities of the bank arose subsequent to the rights of the surety.
So it is in this case. A substantial part of the proceeds of the loans, as well as all of the payments by the surety, went into the construction projects. It did not act for the purpose of being subrogated to the rights of laborers and materialmen. The surety's payment of the claims of laborers and materialmen, as much as the use of the proceeds of the bank loans, created the fund which the bank now seeks. Had the surety failed to pay, and had the municipalities exercised their superior right to make such payments and thereby insure completion of the contracts, no fund would exist and the surety's liability would be limited to the claims remaining unpaid. These equities being equal, the deciding factor is the nature of the competing claims. The bank acted in reliance on the rights of the contractor, whose default forfeited the right to final payment. The surety acted under compulsion of its obligation and thus became subrogated to the prior rights of the municipalities.
3. Finally, Minn.St. 521.02[8] does not aid the bank in defeating the surety's right to the funds. While the statute deals with the type of assignment made, it protects only those rights "which the assignor has power to transfer," i. e., which have in fact been transferred by the assignment. The contractor could not convey an absolute right to the bank to receive final payment, but only all rights then held by it. Its right to final payment was expressly subject to forfeiture for default in payment of laborers and materialmen. The bank thus received no greater right to the funds. Although the assignment to the bank was effective before the prior assignment to the surety, conditioned as it was upon the contractor's default, that factor has no significance because the surety's rights are based upon subrogation and clearly relate back to the date of the surety agreement. Barrett Bros. Co. v. County of St. Louis, 165 Minn. 158, 206 N.W. 49, 10 Minn.L. Rev. 357. We are thus thrown back to the Minnesota law of priority, which compels awarding funds to the surety in preference to the bank.
The opinion filed herein on October 29, 1965, is withdrawn, and the foregoing opinion is substituted in place thereof.
Reversed.
OTIS, Justice (dissenting).
I respectfully dissent from the foregoing opinion because I believe it unduly restricts and narrows the rules we have heretofore adopted governing the respective rights of banks and sureties.
I am not impressed by the fact that the record does not expressly state that the *498 contractor "promised" to use the May 17 bank loan for the payment of labor and material. The vice president handling the matter testified:
"Yes, the stipulation was that of course the loan would be repaid upon liquidation of the receivable involved and Mr. Spadaccini was told that the funds were to be used for the payment of bills in connection with the job involved."
Clearly, by accepting the loan with the conditions thus imposed the contractor was bound to apply the proceeds to the uses specified, and to the extent they were used for that purpose I would hold that the bank is entitled to reimbursement from the municipalities for which the work was done. I concede, however, that the record does not support a finding that the loan of June 8, 1960, was impressed with these conditions.
I cannot agree that Farmers State Bank of Madelia, Inc., v. Burns, 212 Minn. 455, 4 N.W.2d 330, 5 N.W.2d 589, has no application to a consideration of the matter at hand. The fact that the contract in the Burns case permitted the municipality to withhold until completion only 10 percent of the proceeds is, in my opinion, a difference without a distinction. In that case, as in this, (1) the surety was subrogated to all of the contractor's rights by the terms of the bond application; (2) the bank thereafter loaned money to the contractor when the project was already underway, at a time when the bank was under no obligation to do so; (3) the bank took an assignment of payments due the contractor from the municipality; (4) and one of the issues was whether the bank or the surety had a superior equity in the amounts due from the municipality to the contractor following the contractor's insolvency.
Although the municipality in the Burns case wrongfully applied funds due the contractor to labor and material, nevertheless the bank and the surety both laid claim to the amounts earned by the contractor which in that case were diverted to satisfy his debts. There, speaking through Mr. Justice Olson, we quoted with approval the rule that (212 Minn. 462, 4 N.W.2d 334) 
"`* * * Where the bond is furnished the surety must recognize the possible occurrence of what here did occur as one of the perils of its business. In other words one who becomes surety takes the risk that honest payment of unsecured debts may leave a deficiency which the surety must make good.' * * *
"`The surety, in modern business, should be, and usually is, quite able to care for itself. It selects those for whom it becomes surety. * * *'
* * * * * *
"* * * [T]hose who write surety bonds are, generally speaking, regarded as underwriters of contracts of insurance. They are not favored by the law. They are experts in the business of appraising risks."
We concluded by holding that the municipality was liable to the bank and that the surety which claimed priority "is not entitled to any remedy or relief." 212 Minn. 466, 4 N.W.2d 336.
In my opinion, the result here is governed by the Burns rule and that which we adopted in New Amsterdam Cas. Co. v. Wurtz, 145 Minn. 438, 441, 177 N.W. 664, 665, where we stated:
"* * * [I]n advancing its money to the contractor for the purpose stated, it relieved [surety] from its obligation to pay them. If [surety] may now compel the bank to refund, it will be the gainer and the bank the loser in a double sense. If the bank must pay the amount advanced a second time, it *499 will lose $4,500 and interest, and with this money [surety] will be able to satisfy unpaid claims for which it is responsible, and thereby be the gainer at the expense of the bank. A mere statement of the result that would follow if [surety's] contention were sustained demonstrates its want of equity.
* * * * * *
"The equities are clearly with the bank, and equity is of the essence of the doctrine of subrogation."
Viewed in this light, the conclusion is to me inescapable that every cent loaned by the bank and applied on contracts where Fidelity & Casualty Company was the surety relieved the surety to that extent of the obligation it assumed, for a premium, to indemnify labor and materialmen.
Nor is it clear to me how the surety has been prejudiced by failure to notify it of the loan. The implication seems to be that the surety would thereby have been alerted to the contractor's financial condition. However, it is common, if not standard practice, for small contractors to finance their operations in this manner. Were a subordination agreement necessary, clearly none would be forthcoming, since it is inconceivable that a surety would for any reason gratuitously consent to relinquish what security it had. Loans to a small contractor of the kind here made may well spell the difference between his ability to complete the contract and the necessity for his defaulting. To dry up these resources will benefit neither the bank, the municipality, labor and materialmen, or the surety.
I would therefore hold that to the extent the May 17 loan was applied to labor and material, the bank is entitled to priority.
NELSON, Justice (dissenting).
I join in the dissent of Mr. Justice Otis.
NOTES
[1]  Minn.St. 574.26 provides: "No contract with the state, or with any municipal corporation * * *, for the doing of any public work, shall be valid for any purpose, unless the contractor shall give bond to the state or other body contracted with, for the use of the obligee and of all persons doing work or furnishing skill, tools, machinery, or materials * * *, conditioned for the payment, as they become due, of all just claims for such work, tools, machinery, skill, materials * * * for the completion of the contract in accordance with its terms, for saving the obligee harmless from all costs and charges that may accrue on account of the doing of the work specified * * *."
[2]  Henningsen v. United States Fidelity & Guaranty Co., 208 U.S. 404, 28 S.Ct. 389, 52 L.Ed. 547; Prairie State Nat. Bank v. United States, 164 U.S. 227, 17 S.Ct. 142, 41 L.Ed. 412. See, also, Pearlman v. Reliance Ins. Co., 371 U.S. 132, 83 S.Ct. 232, 9 L.Ed.2d 190.
[3]  Hartford Acc. & Ind. Co. v. Federal Const. Co., 168 Minn. 202, 209 N.W. 911; Standard Oil Co. v. Remer, 167 Minn. 352, 209 N.W. 315; Barrett Bros. Co. v. County of St. Louis, 165 Minn. 158, 206 N.W. 49, 10 Minn.L.Rev. 357.
[4]  43 Yale L.J. 1135.
[5]  Town of River Junction v. Maryland Cas. Co. (5 Cir.) 110 F.2d 278, certiorari denied, 310 U.S. 634, 60 S.Ct. 1077, 84 L. Ed. 1404; Southern Exch. Bank v. American Surety Co., 284 Ky. 251, 144 S.W.2d 203.
[6]  Jordan, The Rights of a Surety Upon the Default of Its Contractor-Principal, 41 Ore.L.Rev. 1, 8; 56 Harv.L.Rev. 1168; 42 Mich.L.Rev. 174.
[7]  Scarsdale Nat. Bank & Trust Co. v. United States Fidelity & Guaranty Co., 264 N.Y. 159, 190 N.E. 330; Moran v. Guardian Cas. Co., 64 App.D.C. 188, 76 F.2d 438; Maryland Cas. Co. v. Board of Water Commrs. (2 Cir.) 66 F.2d 730; Farmers' Bank v. Hayes (6 Cir.) 58 F.2d 34; State ex rel. Southern Surety Co. v. Schlesinger, 114 Ohio St. 323, 151 N.E. 177, 45 A.L.R. 371.
[8]  Minn.St. 521.02 provides: "Subdivision 1. An assignment given for value and evidenced by a writing signed by the assignor and taken in good faith by the assignee transfers all rights respecting the account or accounts described in the writing which the assignor has power to transfer, and is valid, complete and perfected at the time such writing is transmitted to the assignee, whether or not notice thereof is given to the debtor.

"Subd. 2. Thereafter, no purchaser from the assignor of any account so assigned nor any creditor of the assignor can acquire a right in any account so assigned, or in any proceeds thereof or substitute therefor, superior to the rights of the assignee."
