OPINION OF THE COURT
Luciano, J.A lender who takes an assignment of a contract to improve and convey real property as security for a building loan can be held liable as a trustee under Lien Law article 3-A for the claims of subcontractors if it receives direct payment of the sale proceeds pursuant to the assignment and applies those proceeds to repayment of the loan it made to the owner of the property.
The salient facts are undisputed. Berry Street Corp. had a contract with the New York City Housing Authority (hereinafter NYCHA) to acquire certain property in Brooklyn, construct residences thereon, and then convey title to the improved property to NYCHA. In connection with the project, Norstar Bank, the predecessor in interest of the defendant, Fleet Bank, N.A. (hereinafter the bank), made building loans to Berry Street Corp. and took back mortgages. The mortgages stated that they were subject to Lien Law § 13 and were recorded, and the building loan agreement was also recorded, pursuant to Lien Law § 22. As additional security for the building loans, and with the consent of NYCHA, Berry Street Corp. assigned all of its “right, title and interest in, to and under” its contract with NYCHA to the bank. As a result of that assignment, when title was conveyed to NYCHA pursuant to the contract, the proceeds of the sale were paid directly to the bank, which applied such proceeds to repayment of its building loans to Berry Street Corp.
The plaintiffs are subcontractors who worked on the project and allege that they were not paid. They argue that by virtue of the assignment of the contract from Berry Street Corp., the bank became a statutory trustee pursuant to Lien Law article 3-A, and that its use of the sale proceeds to repay the loans it made to the owner was an improper diversion of assets of the statutory trust of which they are beneficiaries. In addition, they assert that the failure to file a notice of lending pursuant to Lien Law § 73 precludes the bank from defending on the ground that it was entitled to use the sale proceeds to repay *99advances it made to Berry Street Corp. pursuant to the building loan agreement and mortgages.
“[T]he primary purpose of the Lien Law is to ensure that ‘those who have directly expended labor and materials to improve real property * * * at the direction of the owner or a general contractor’ receive payment for the work actually performed” (Canron Corp. v City of New York, 89 NY2d 147, 155). Lien Law article 3-A “was designed to create trust funds out of certain construction payments or funds to assure payment of subcontractors, suppliers, architects, engineers, laborers, as well as specified taxes and expenses of construction” (Caristo Constr. Corp. v Diners Fin. Corp., 21 NY2d 507, 512). “Lien Law article 3-A mandates that once a trust comes into existence, its funds may not be diverted for non-trust purposes. Use of trust assets for any purpose other than the expenditures authorized in Lien Law § 71 before all trust claims have been paid or discharged constitutes an improper diversion of trust assets, regardless of the propriety of the trustee’s intentions” (Matter of RLI Ins. Co. v New York State Dept. of Labor, 97 NY2d 256, 263).
The bank argues that it did not become a statutory trustee by virtue of the assignment of the contract between Berry Street Corp. and NYCHA to it because the assignment was made for the sole purpose of securing its loans to Berry Street Corp. The effect of the assignment, however, was to entitle the bank to direct payment of the proceeds of the sale, which, absent the assignment, would have been paid to Berry Street Corp., and been subject to the trust provisions of Lien Law article 3-A (see Lien Law § 70 [1] [“funds * * * received by an owner for or in connection with an improvement of real property in this state * * * shall constitute assets of a trust”]). The bank’s rights, as assignee of the contract, were no greater than the rights of Berry Street Corp., as assignor, whose rights to the proceeds of the sale were subject to the rights of the plaintiffs, as beneficiaries of the statutory trust (see New York Natl. Bank v Primalto Dev. & Constr. Co., 270 AD2d 22; National Sur. Co. v Fishkill Natl. Bank, 61 Misc 2d 579, affd 37 AD2d 537).
As a statutory trustee under Lien Law article 3-A, in order to defend this action on the ground that the trust funds were used to repay advances made to Berry Street Corp., and that such advances were actually applied to a trust purpose, the bank would have to have filed a notice of lending in accordance with Lien Law § 73 (see Eljam Mason Supply v I.F. Assoc. Corp., *10084 AD2d 720, 721). We disagree with the bank’s contention that its building loans had priority over the claims of subcontractors because it complied with Lien Law § 13 (3) and § 21 by including the trust fund covenant language in the mortgage and recording the building loan agreement. In its capacity as trustee under Lien Law article 3-A, the bank could only defend on the ground that the transfer of trust assets was made to repay advances made by it, and that such advances were used for a trust purpose, if a notice of lending had been filed. Since it is undisputed that the bank did not file a notice of lending, the repayment to itself of the loans made to Berry Street Corp., with knowledge of their trust status, was a diversion of trust assets as a matter of law.
The bank’s remaining contentions are without merit.
Accordingly, the order is affirmed.
Florio, J.P., McGinity and Schmidt, JJ., concur.
Ordered that the order is affirmed, with costs.