delivered' the opinion of the court.
This is an action brought by Sherberg against the bank to recover damages allegedly occasioned by setting off against the deposit of the Ray Essert Industries, Inc., a corporation, a débt due the bank from Ray Essert individually, which deposit was made with funds furnished by Sherberg for the specific purpose of completing the construction of his home. The trial court’s judgment of dismissal of the action is here for review.
The facts are that on or about July 1, 1947, Sherberg, plaintiff in error, entered into a contract with the Ray Essert Industries, Inc., a corporation, and Ray Essert individually, for the construction of a dwelling house. There was paid on account of said contract prior to September 4, 1947, the sum of $8,000. When Sherberg’s *409available funds were about exhausted, and upon the suggestion and with the assistance of Ray Essert, he applied to defendant in error bank for a loan, which was consummated September 22,1947. A cashier’s check for $15,000 was issued by the bank to Sherberg, endorsed by him, and delivered to Essert. The proceeds of the loan were thereupon deposited in the Ray Essert Industries, Inc., account. The bank’s daily ledger on the above date shows the deposit of the above amount with a pencil notation, “Hold—10,000.00.” While it clearly appears that the bank’s president, Mr. Smoot, personally handled the entire loan transaction, he was nevertheless unable to explain in the trial court the pencil notation, identify its author, or fix the date upon which it was made. However, two days after the deposit was made and upon September 24, 1947, the bank set off against said account, without the knowledge or consent of either Sherberg or Essert, the sum of $10,000, plus interest, and applied same to the payment of Essert’s personal unsecured note of the same amount, dated July 12, 1947, and due October 10, 1947. It further appears that during the negotiation for the loan the bank and its president were fully advised, as is admitted, that the purpose of the loan was to complete the financing of the Sherberg home.
Upon discovery of said setoff, approximately two week later, Sherberg immediately protested to the president of the bank, and was thereupon advised as Smoot testified, “We explained to Dr. Sherberg that we had been advised by the bank examiners that we had an excessive loan in the bank and consequently we were forced to make that charge to Mr. Essert’s [meaning the Ray Essert Industries, Inc.] account.”
At the time the loan was made the bank’s president, knowing Essert’s strained financial condition, his excessive loans at the bank, and the criticism thereof by the bank examiners, failed to inform Sherberg thereof, and remained silent with respect thereto until after the de*410posit was made and the setoff completed. It seems reasonable to assume in passing that if Sherberg had known the true facts he would not have endorsed the check to Essert or permitted it to be deposited in the account, of the Ray Essert Industries, Inc., but instead would have kept the proceeds of the loan in his own account and checked against it as the construction of his home progressed. He was interested, as the bank well knew, in building a home, and not in paying Essert’s debts.
It is argued by the bank’s counsel that because there was no privity of contract, or relationship of creditor and debtor subsisting between Sherberg and the bank, the bank owed no duty to Sherberg and that this action cannot be maintained. We are not impressed with the above argument under the circumstances here presented. Under the following authorities, when a bank knowingly accepts a deposit for a specific purpose, it cannot thereafter divert the same for its own benefit or otherwise act to defeat the purpose for which the deposit was made.
The right of one for whose benefit a deposit is made to maintain an action against the bank for the wrongful diversion thereof is recognized in Boettcher v. Colorado National Bank, 15 Colo. 16, 24 Pac. 582. In that case plaintiff in error Boettcher held certain checks issued by Shackleton & Brinker, a copartnership, in payment for wheat purchased from Boettcher, and which was to be paid for from the proceeds of the sale of flour. Shackleton & Brinker maintained a general checking account in the Colorado National Bank. Instead of paying the checks as they were presented, the bank applied the amount on deposit upon a note due the bank. We held, under the circumstances there present, that Boettcher could not recover and in so doing stated the rule applicable here: “Admitting the course of business between appellant and Shackleton & Brinker to have been as stated, and appellant by the course of trade or by an agreement equitably entitled to the proceeds of the *411wheat for its payment, such fact could not affect appellee unless it was a party to such contract, or at least had knowledge of it. Appellee could only be made liable in equity, as trustee, by the allegation and proof of a contract creating a trust to which it was a party, or which, after due notice of its trusteeship, it failed to repudiate. * * * The deposit by Shackleton and Brinker was a general deposit to their credit. To constitute it a trust fund for the purpose indicated, it should, either by express agreement or by circumstances indicative of an intent to make it such, have been given the character of a special deposit.” (Italics supplied)
The situation here is quite comparable to that involved in Drovers National Bank v. Denver Live Stock Exchange, 74 Colo. 212, 220 Pac. 402, where we held, as set out in paragraph 4 of the syllabus: “A bank has no right to take the deposits of a customer for the payment of his debt to it, where it has knowledge that the money so applied is in fact the property of another.”
It is quite generally held in other jurisdictions that there is no particular formula prescribed for a contract involved in making a special deposit in a bank or a deposit for a specific purpose, and the nature thereof is determined by the mutual intent and understanding of the parties thereto. Also, when a bank knowingly accepts a deposit of money, as here, for a specific purpose, it thereby impliedly binds itself not to set off against such deposit a debt due it from the depositor. 7 Am. Jur., §418, p. 292, et seq; Engleman v. Bank of America (Calif.), 219 P. (2d) 868.
In the instant case, as hereinbefore stated, the bank, although not a party to the building contract between the depositor, the Ray Essert Industries, Inc., and Sherberg, through its officers, knew that the latter’s funds were exhausted, and by reason thereof loaned him money to enable him to complete his home. It also knew of the arrangements to place the proceeds of the loan in the Ray Essert Industries account so as to facilitate the *412payment of labor and material bills and the completion of the construction of said home.
The correct rule with respect to the right of set-offs by banks is well stated in the recent case of American Surety Co. v. de Escalada, 47 Ariz. 457, 56 P. (2d) 665. We quote from paragraph 2 of the syllabus: “Generally, where bank has in its possession assets of debtor, bank may apply these assets to payment of a matured debt or, in case of insolvency of debtor, to an unmatured one, but such right may be controlled by any special agreement which shows a different intent or where circumstances or particular modes of dealing are inconsistent with such right.”
In 9 C.J.S., page 615, section 296, is the following statement: “The more generally accepted view is that such right grows out of the debtor and creditor relation subsisting between bank and depositor, and finds its basis in the right of set-off, and in the application of equitable principles. The right of set-off ordinarily applies to a general deposit and continues while the relationship between bank and depositor is that of debtor and creditor in respect of his deposit, although it has been said that the rule is effective only where the transaction between bank and customer constitutes a deposit, creating the relation of banker and depositor as between the bank and its debtor, and as shown in §§303 and 304 infra, in the case of a special deposit, as where money is deposited for a special purpose, the bank is ordinarily precluded from exercising the right of set-off.”
Counsel for the bank, in effect at least, concede that the action of the bank in making the setoff was wrongful, when they state in their brief that, “It would have been probable that had the bank been requested by Sherberg to make such reinstatement into Essert’s corporate account, that the bank would have readily done so,” and in their answer brief on petition for rehearing counsel say: “The bank could not refuse to do something it had not been asked to do. It will be recalled *413that the hank offered to reinstate the funds to the corporate account when Essert and his attorney appeared in protest.”
The fact that Essert, some time after the setoff attempted to ratify the wrongful act of the bank in setting off against the deposit of the corporation the debt of an individual stockholder, cannot relieve the bank. It was its duty to restore the funds wrongfully taken from the corporate account when the protest of Sherberg was made. The following excerpt from Drovers National Bank v. Denver Live Stock Exchange, supra, is pertinent here. “The sum was illegally taken in the first instance and had the customers sued the bank they could have recovered. * * *
“The company [commission], in appropriating the money of its customers, plundered the interests, violated the principles and destroyed the confidence whose protection, promotion, and inspiration was the purpose of the organization of the exchange and the duty of its members. All this was with the knowledge and participation of the bank, and it was the beneficiary thereof. It is, therefore, directly responsible for the customer’s loss, for the violation of the by-laws of the exchange, for the suspension of the memberships, and indirectly for the payment by the exchange to the customers of the sum in question. Hence we are compelled to say to plaintiff that if it is in a court of equity it did not come with clean hands.”
Other authorities in conformity with the conclusion's herein reached are: Cassedy v. Johnstown Bank, 286 N.Y.S. 202, 246 App. Div. 337; Peoples State Bank v. Caterpillar Tractor Co., 213 Ind. 235, 12 N.E. (2d) 123; Witherow v. Weaver, 337 Pa. 488, 12 A. (2d) 92; Sherts v. Fulton Nat. Bank of Lancaster, 342 Pa. 337, 21 A. (2nd) 18.
The judgment of the trial court is reversed and the cause remanded for further proceedings in harmony with the views herein expressed.
*414Mr. Justice Jackson and Mr. Justice Stone dissent.