
92 Wn.2d 381 (1979)
598 P.2d 701
CARL B. WARREN, ET AL, Petitioners,
v.
WASHINGTON TRUST BANK, Respondent.
No. 45600.
The Supreme Court of Washington, En Banc.
July 26, 1979.
*382 William D. Symmes, Eric K. Nayes, and Witherspoon, Kelley, Davenport & Toole, for petitioners.
Robert H. Whaley, P.H. Winston, and Winston & Cashatt, for respondent.
ROSELLINI, J.
This case involves the respective rights of a surety and a creditor in regard to payments made to and collateral placed in the hands of the creditor. The facts are set forth in detail in the opinion of the Court of Appeals, Division Three, in Warren v. Washington Trust Bank, 19 Wn. App. 348, 575 P.2d 1077 (1978), and need only be summarized here.
In 1968, Electric Smith Construction & Equipment Company (herein called the construction company), of which Charles E. Walters was vice president and principal shareholder, was indebted to the respondent bank in the amount of $375,000. At that time it was engaged in the performance of a contract with Reynolds Metals Company, using funds supplied by the bank. Reynolds cancelled the contract, and a lawsuit was begun. The construction company found itself in need of $150,000 to meet the bank's demand that it reduce its indebtedness and to provide working capital. The bank was unwilling to loan more money to the construction company and was also unwilling to loan the $150,000 to Walters on his own credit. It agreed, however, to loan the money to Walters, with his father-in-law, Carl B. Warren, endorsing the note of Walters and furnishing cash security in the form of a certificate of deposit for the full amount of the loan.
The proceeds of the loan were paid by check made to Walters and Warren, which Walters deposited in his personal account. He then drew a check for $150,000 payable to the construction company. After receipt of the funds, the construction company gave Walters a note in that amount to evidence its indebtedness to him. That note was subsequently reduced to $116,289.55 by the allowance of credits *383 for personal services rendered to Walters by the construction company.
Walters assured his father-in-law that the note would be paid with proceeds from the litigation. Apparently both assumed that the construction company would prevail in the lawsuit.
The construction company-Reynolds litigation was successfully terminated in 1971. In the meantime, the Walters-Warren note at the bank had been renewed several times. Also, in the interim, the construction company had assigned to the bank a sufficient amount of the proceeds of the judgment against Reynolds to pay off its indebtedness to the bank, and had assigned some of the judgment proceeds to Walters as security for its note to him. Walters in turn had assigned the note and its security document to the bank to secure his obligations to it. These included two notes of the Walters' community as well as the $150,000 Walters-Warren note which was secured by the certificate of deposit.
When the proceeds of the judgment were received, $89,422.14 was paid to Walters in partial satisfaction of the construction company's note, and a new note was executed by the company to cover the $26,867.41 balance. The judgment proceeds were received by the bank, which paid the $89,422.14 in accordance with directions given by Walters. He directed that $75,682.97 be applied to the payment of the two Walters' notes; that $5,250 be applied as prepaid interest on the notes on which Warren was an endorser; and that a cashier's check for the balance of $8,489.17 be made to the construction company, himself, and the Old National Bank. He also instructed the bank to release to the Old National Bank the collateral given for the construction company's note. At that time, Walters was indebted to the Old National Bank, where Warren was his surety, as well as to the Washington Trust Bank.
When the Walters-Warren note fell due and was not paid, the bank cashed the certificate of deposit, cancelled the debt, and returned the note to Walters.
*384 The Superior Court held that the bank was obliged to apply the money which it received from Walters to the payment of the Walters-Warren note and to hold the construction company's $26,867.41 note (collateral for its note to Walters) for the benefit of Warren. Having failed to do so, it decided, Warren was released from liability as surety in the amount of cash received and applied to other indebtedness of Walters and in the amount which the Old National Bank eventually realized upon the note of the construction company, which was $20,000.
The Court of Appeals reversed the Superior Court's ruling with respect to the bank's obligation to apply payments but did not discuss the question involved in the release of the collateral represented by the construction company's note. It did, however, reverse the money judgment in its entirety, and thus impliedly found merit in the bank's contention that the release did not prejudice the rights of Warren.
It was the holding of the Court of Appeals that the bank was within its rights when it applied the payment received from Walters in accordance with his instructions. Warren contends that this holding is in conflict with Associated Indem. Corp. v. Del Guzzo, 195 Wash. 486, 81 P.2d 516 (1938); Sturtevant Co. v. Fidelity & Deposit Co., 92 Wash. 52, 158 P. 740 (1916); Fidelity & Deposit Co. v. Northwestern Nat'l Bank, 90 Wash. 179, 155 P. 743 (1916); and Crane Co. v. Pacific Heat & Power Co., 36 Wash. 95, 78 P. 460 (1904), all of which recognize the right of a surety, under certain limited circumstances, to have payments made by his principal to the creditor applied to the account upon which the surety is liable.
[1] It is the general rule that, where a principal owes more than one obligation to a creditor and makes payments out of his own funds, in the absence of agreement or special equities, the creditor is bound to apply the payments in accordance with the principal's directions, and if there are no directions, he may apply the payments as he sees fit. Armour & Co. v. Becker, 167 Wash. 245, 9 P.2d 63 (1932); *385 Sturtevant Co. v. Fidelity & Deposit Co., supra; United States Fid. & Guar. Co. v. E.I. DuPont De Nemours & Co., 197 Wash. 569, 85 P.2d 1085 (1939); 72 C.J.S. Principal & Surety § 144 (1951); Restatement of Security § 142 (1941); A. Stearns, The Law of Suretyship § 7.23 (5th ed. J. Elder 1951); L. Simpson, Handbook on the Law of Suretyship § 44 (1950). See Application of payments as between debts for which a surety or guarantor is bound and those for which he is not, Annot., 57 A.L.R.2d 855 (1958).
These authorities further state that where the principal has given no directions and the creditor has not credited the payment to any particular debt, some courts will apply the payment so as to give the creditor the best security; others will apply it to the oldest debt; and others have said that it should be applied in accordance with the intent of the parties as ascertained from the surrounding circumstances.
The exceptions to these rules occur only where the surety is the beneficiary of an agreement or can demonstrate a special equity which makes his interests more amenable to protection than those of the creditor and the principal.
Of course, if the debtor and creditor as well as the surety or guarantor are parties to an agreement relating to the application of payments, they must be applied in accordance with the terms of the agreement. This case does not involve such an agreement. While there was an understanding between Walters and his father-in-law that this obligation would be paid out of receipts from the construction company, there was no agreement to apply the first moneys  or any particular moneys  received from the construction company to the payment of the debt; and the bank did not agree that moneys derived from that source would be so applied. It was undoubtedly aware that both Walters and Warren hoped to be able to repay the loan out of the proceeds from the construction company's litigation, but it made no commitment nor was it equitably bound to apply payments contrary to Walters' directions because of that awareness.
*386 The equitable considerations which will give a surety the right to compel application of payments to the account upon which he is surety are summarized in A. Stearns, supra at 241-42. After remarking that the rules which the courts have applied have been developed in an effort to do whatever is most equitable under the circumstances, the text writer says:
Following this principle, it has sometimes been held that the payment should be applied to the debt for which there is a surety. Thus, if the surety furnishes the principal with money to pay the debt on which he is surety, the creditor must apply the money to such debt, unless he is unaware of the source of the money. When payments are made from the proceeds or fruits of a contract, business or transaction covered by the obligation of a surety, and when the source of the funds is known to the creditor receiving the same, the surety equitably is entitled to have the payments applied to the discharge of the debt for which he is bound, even though other application has been made by the creditor.
Again, where the creditor receives from the principal the specific payment or performance that the surety promised would be paid or performed, the surety has the right to direct the application of such payment or performance to the obligation for which is he liable.
(Footnotes omitted.)
[2] Of these exceptions to the general rule, the one which Warren claims fits his circumstances is that which involves payment from the proceeds of a contract, business or transaction, covered by the obligation of the surety; and it is with this exception that the cases which he cites are concerned.
In Associated Indem. Corp. v. Del Guzzo, supra, the surety on a performance bond was accorded the right to have funds known to have been received as the proceeds of the contract for which it was surety, applied in payment of debts incurred in carrying out that contract. In Sturtevant Co. v. Fidelity & Deposit Co., supra, however, it was held that a surety upon a contractor's bond to secure labor and *387 materialmen was not discharged by the fact that a materialman receiving a payment, which was furnished by the owner, applied it to a debt of the contractor upon which the surety was not liable, where the materialman did not know the source of the payment.
Fidelity & Deposit Co. v. Northwestern Nat'l Bank, supra, was another case involving a construction contract. There a bank had advanced money to the contractor, who used portions of it for purposes other than the completion of the work. It was held that the surety, who took over the performance of the contract when its principal announced itself unable to complete it, was not liable to the bank for repayment of those sums which were not used in completion of the contract. That case did not involve a question of application of payments made to the creditor, but rather the right of a creditor to recover from a surety amounts which it had advanced to the principal and had permitted him to use for purposes other than the performance of the contract which the surety guaranteed.
Crane Co. v. Pacific Heat & Power Co., supra, was a case in which an indemnity company had guaranteed payment of a materialman for supplies furnished in connection with the construction of a school heating system. When the contractor received payment from the school district and transmitted it to the materialman, the latter applied it to other debts of the contractor. This court said that, since the moneys applied upon the old debts were the very moneys for the collection and payment of which the surety was obligated to the creditor, the surety could require that they be applied to the debt upon which it was liable.
It will be seen that all of these cases were concerned with the rights of a surety upon a bond for the faithful performance of the principal's obligations. Such bonds are generally supplied by a contractor for the benefit of the owner of the property upon which work is to be done, to guarantee that the contract will be faithfully performed within the contract price. They also benefit the suppliers of labor and materials, since they guarantee that these creditors will be *388 paid. Rivier College v. St. Paul Fire & Marine Ins. Co., 104 N.H. 398, 187 A.2d 799 (1962).
Other undertakings may be involved, but these are the ones which are significant with respect to the surety's equity in the payments made. It is because he has an obligation to the owner, who is the source of the payment, to see that the moneys paid by the owner are received by the creditor and applied to the contract for which he is surety, that the courts have found a special equity in his behalf which gives him the right to have the payments credited to the account in which he is interested, provided the creditor is aware of the source. Unlike the situation in the case before us, the supplier of a performance bond does not contract with the creditor. Rather, the suppliers of labor and materials are beneficiaries of the contract made with the owner and principal. But it is primarily for the benefit of the owner, and because the surety has undertaken to protect his interest and will be liable if he does not accomplish this, the courts have recognized an equity superior to that of the creditors in applying payments received from the principal as he or they see fit.
Warren contends that payments made by the construction company on its note to Walters should have been applied to repayment of the note on which he was liable. But he had no contractual relationship with this company, and it had no concern with the application which the bank might make of the payments. Thus the special equities which characterize the performance bond cases are absent here.
It is true that officers of the bank knew that the loan would be used to finance the construction company's activities and the reduction of its debt to the bank, but this knowledge created no equity on behalf of the surety for the loan. It is quite apparent that the bank was unwilling to place any reliance on the credit of the construction company, or even that of the borrower, but demanded and *389 received a liquid asset sufficient to cover the entire obligation. This was the bargain which it made, and it is entitled to its benefit.
Warren's expectations regarding the repayment of the loan with funds received from the construction company may perhaps have created some equitable right against his principal, but it is doubtful that he could have exercised that right to the prejudice of the bank. The bank had a right to insist that the money be applied to Walters' other obligations, since it held the assignment of the construction company's note and the assignment of judgment proceeds securing it, pursuant to which the payment was made, primarily as security for payment of those obligations.
The Court of Appeals correctly held that the bank was entitled to utilize payments made by Walters out of the proceeds of the construction company's recovery in the Reynolds' litigation, which had been assigned to him and in turn assigned to the bank, in payment of the obligations of Walters upon which Warren was not a surety.
Warren further contends that the Court of Appeals erred in reversing that portion of the judgment which allowed him to recover from the bank the sum of $8,489.17, which it had released to Walters and the Old National Bank in accordance with Walters' directions, as well as the value of the construction company's $26,867.41 note, which had likewise been released to Walters and the Old National Bank. The Court of Appeals did not treat this question as a separate issue, but apparently assumed that it was covered by its decision with respect to the right of the bank to apply payments as directed by Walters.
We will assume, for purposes of argument, that because these items represented part payment of a note which had been assigned to the bank to secure personal notes of Walters "and any and all other obligations" of Walters, they became assets which were available to the bank for use in discharging the Walters-Warren note. As such, they could not be released by the bank to the injury of Warren, the surety.
*390 [3] The general rule is that, if the creditor has a surety for the debt and also has a lien on the property of the principal for the security of the same debt and he relinquishes such lien, the surety is, to the extent of the value of the lien thus lost, discharged from liability. State v. Hartford Accident & Indem. Co., 140 Wash. 278, 248 P. 432 (1926). As revealed in 1 G. Brandt, The Law of Suretyship & Guaranty § 480 (3d ed. 1905), this rule does not depend upon the contract between the surety and the creditor, but results from equitable principles inherent in the relationship of surety and principal. It is equitable that the property of the principal, pledged for the payment of the debt, should be applied to that purpose, and is grossly inequitable that in such case the property should be diverted from that purpose and the debt thrown upon a mere surety.[1]
In harmony with the equitable principles which govern this rule, it is held that the surety is not discharged unless he is injured by the release of the collateral. 1 G. Brandt, supra at § 493. Release of a security may injure the surety's right of subrogation, and to the extent that it does so, the surety is discharged. Restatement of Security § 132 (1941).
Here the record shows that Walters had made a second assignment of the construction company's note to the Old National Bank to secure a debt upon which he and Warren were liable. This being the case, Warren's right of subrogation upon payment of the obligation at the Washington Trust Bank would have been junior to the claim of that bank under its assignment from Walters. As it was, the collateral was released to that bank and used to partially discharge the Walters-Warren obligation. This resulted in the same benefit which would have accrued to Warren, had the collateral been held by the bank until the note became due and was paid by resort to Warren's certificate of deposit. *391 Warren could not assert a claim superior to that of the Old National Bank, which held a previously executed assignment of these assets.
Since Warren suffered no injury as a result of the release of this collateral, he cannot claim the benefit of the rule relied upon.
Warren asks the court to review the determinations of the Court of Appeals with respect to the liability of the Walters' community and the effect of the bank's release of a mortgage on certain Priest Lake property when the loan for which it was given was not consummated. We have examined the court's treatment of these questions and find it to be correct.
As modified herein, the decision of the Court of Appeals is affirmed.
UTTER, C.J., STAFFORD, WRIGHT, BRACHTENBACH, HOROWITZ, DOLLIVER, and HICKS, JJ., and HAMILTON, J. Pro Tem., concur.
Reconsideration denied December 26, 1979.
NOTES
[1]  As to the surety's right to compel a creditor to apply assets of the principal to the debt, see Restatement of Security § 131 (1941). As stated there, it is the general rule that, even though the creditor has a security interest in property of the principal, he may proceed first against the surety before resorting to the security interest.
