
152 Cal.App.3d 767 (1984)
199 Cal. Rptr. 557
BANK OF AMERICA, Plaintiff and Respondent,
v.
RICHARD A. DAILY, as Administrator, etc., et al., Defendants and Appellants.
Docket No. 24459.
Court of Appeals of California, Fourth District, Division One.
March 2, 1984.
*769 COUNSEL
Richard A. Daily, in pro. per., for Defendants and Appellants.
George W. Coombe, Jr., Ullar Vitsut, Thomas R. Cory, Louis J. Bachleder and Harris B. Taylor for Plaintiff and Respondent.
OPINION
WIENER, J.
We address another facet of the one-form-of-action rule of Code of Civil Procedure section 726.[1] That section provides in part: "(a) There can be but one form of action for the recovery of any debt for the enforcement of any right secured by mortgage [or deed of trust[2]] upon real property, which action must be in accordance with the provisions of this *770 chapter...." Notwithstanding this apparently clear and unambiguous language, California courts have interpreted this provision as giving the secured creditor entitled to a deficiency judgment an election of remedies. (Washburn, The Judicial and Legislative Response to Price Inadequacy in Mortgage Foreclosure Sales (1980) 53 So.Cal.L.Rev. 843, 927.) (1) "[W]here the creditor sues on the obligation and seeks a personal money judgment against the debtor without seeking therein foreclosure of such mortgage or deed of trust, he makes an election of remedies, electing the single remedy of a personal action, and thereby waives his right to foreclose on the security or to sell the security under a power of sale. [Citations.]" (Walker v. Community Bank, supra, 10 Cal.3d at p. 733.)
The question here is whether the plaintiff Bank of America National Trust and Savings Association (Bank) waived its right to judicially foreclose a deed of trust because it unilaterally set off the amount of accrued interest due on a delinquent loan secured by that deed of trust from the checking account of defendants/debtors, Mary L. and Robert A. Daily.[3] We conclude this question must be answered affirmatively. We therefore reverse the judgment in favor of the Bank with instructions to enter judgment for defendants and for further proceedings consistent with this opinion.

Factual and Procedural Background
Defendants Mary L. and Robert A. Daily, as depositors and borrowers, had a long-standing commercial relationship with the Bank. By July 19, 1966, they owed the Bank $340,000 evidenced by a promissory note secured by pledged common stock. In June 1968 the stock had declined in value and the Bank asked the Dailys for additional collateral. Pursuant to that request, the Dailys signed a deed of trust on June 14, 1968, encumbering their 10 percent interest in 245 acres of land in the City of Carlsbad, County of San Diego.[4] From time to time the Bank renewed the Dailys' obligation. Finally, on October 8, 1970, in order to collect the note which was then in default, the Bank sold the pledged stock at a private sale. On October 16 the Bank applied the proceeds of the sale, $257,009.47, to the principal balance of the note and set off from the Dailys' checking account $10,412.50 for accrued interest on the debt for the period June 12 to October 16, 1970. After Robert A. Daily died and his estate failed to pay the outstanding debt, the Bank filed this action to judicially foreclose the Carlsbad deed of trust.
*771 The court found $82,990.53 principal plus $88,215.40 interest was due on the Dailys' note. The court determined the Bank's exercise of its right of setoff did not result in a waiver of its recourse to other property owned by the Dailys and entered a judgment of foreclosure on the Carlsbad property, retaining jurisdiction to determine the amount of any deficiency. As part of the judgment, the court ordered the Dailys to pay $3,000 attorney fees to the Bank. This appeal by the Dailys ensued.

Discussion
(2a) The Bank's argument against the application of section 726 in this case is quite straightforward. The Bank asserts its setoff against the Dailys' checking account was not judicial action and thus did not constitute the one action allowed by section 726 for its recovery of the Dailys' debt. Accordingly, the Bank argues its setoff can have no legal effect upon its later judicial foreclosure.
If this were an original question the Bank's argument might have some merit. Section 22 defines "action" as "an ordinary proceeding in a court of justice by which one party prosecutes another for the declaration, enforcement, or protection of a right, the redress or prevention of a wrong, or the punishment of a public offense." Thus, in the classic sense of a judicial proceeding initiated by complaint, a checking account setoff is not an "action."
(3) (See fn. 5.), (2b) Our Supreme Court, however, has long since put this issue to rest. McKean v. German-Am. Savings Bank (1897) 118 Cal. 334 [50 P. 656] held a bank setoff against a general deposit account[5] is an "action" within the meaning of section 22 for the purpose of applying the one-form-of-action rule of section 726. (Id., at pp. 340-341; accord, Gnarini v. Swiss American Bank (1912) 162 Cal. 181, 184 [178 P. 532]; Woodruff v. California Republic Bank (1977) 75 Cal. App.3d 108, 110 [141 Cal. Rptr. 915].) (4) It is now established law that where "the obligation of the depositor is represented by a note secured by a mortgage [or deed of trust], C.C.P. 726 prevents the bank from satisfying it by exercising its setoff; it must exhaust the security. [Citations.]" (2 Witkin, Summary of Cal. Law (8th ed. 1973) Negotiable Instruments, § 129, p. 1387.) (5) "Where a bank has security for the indebtedness of a depositor, the reason for the rule which gives a bank the right to appropriate deposits for the payment of the depositor's matured indebtedness does not apply, and the *772 ordinary presumption that it is the depositor's intent to have his indebtedness discharged from his deposit does not exist. The rule is, therefore, that a mortgagee [or beneficiary] bank must first look to the mortgaged [or encumbered] premises as constituting a primary fund out of which the debt secured by the mortgage [or deed of trust] must be paid, and that mortgage [or deed of trust] security must be exhausted before it can apply in reduction or cancellation of the debt any money on deposit with it belonging to the debtor." (9 Cal.Jur.3d, Banks and Other Financial Institutions, § 132, pp. 346-347, fns. omitted.)
The fact the Bank's setoff was an action for the recovery of the Dailys' debt within the scope of section 726 does not fully resolve the issue before us. The question remaining is what sanction is appropriate for the Bank's section 726 violation.
(6) Arguably the fairest sanction is to require the Bank to refund to the Dailys the money taken from their checking account plus accrued interest as a condition to proceeding with the judicial foreclosure. This approach returns the parties to the position they were in before the setoff and avoids the harshness of precluding the Bank from foreclosing on its security. Moreover, since the security presumably is worth more than the setoff, this approach also prevents the Dailys from unfairly benefiting from the Bank's setoff action. Otherwise, that action will relieve the Dailys of their obligation to pay the full amount of a debt on which they have personal liability.
Mitigation of harshness, however, may not serve as the rationale for deciding this case. "The classic sanction against the creditor who fails to exhaust all his security for the same debt in a single action is harsh, yet it follows inescapably from the availability of but one action to the creditor  he waives the balance of the security and he waives any claim to the unpaid balance of the debt. [Citations.]" (Hetland, Cal. Real Estate Secured Transactions (Cont.Ed.Bar 1970) Antideficiency Legislation, § 6.18, p. 258.)
The harshness flowing from applying section 726 as a sanction is necessary to uphold the statutory policy of protecting debtors' rights. Modern legislative and case law do not view the defaulting mortgagor (trustor) as a wrongdoer. Several statutory provisions including sections 580b, 580d, 725a and 726 protect those borrowers who default from being disadvantaged by lenders. (Eastland S. & L. Assn. v. Thornhill & Bruce, Inc. (1968) 260 Cal. App.2d 259, 261 [66 Cal. Rptr. 901]; see also Riesenfeld, California Legislation Curbing Deficiency Judgments (1960) 48 Cal.L.Rev. 705, 705-710.) Although the Dailys do not come within sections 580b or 580d, they are nonetheless entitled to the protection of the statutory scheme.
*773 The Depression caused the Legislature in 1933 to enact fair market value limitations on judicial foreclosure sales. These restrictions limited the beneficiary's deficiency judgment after exhaustion of the security to the difference between the fair value of the property at the time of the sale, irrespective of the amount actually realized by the sale, and the outstanding debt for which the property was security. (Cornelison v. Kornbluth (1975) 15 Cal.3d 590, 600-601 [125 Cal. Rptr. 557, 542 P.2d 981].) Section 726 not only provides for a three-month limitation period within which the deficiency judgment must be sought, it also requires a noticed evidentiary hearing at which the court determines the fair market value of the property subject to foreclosure. (§ 726, subd. (b).)
(7) Here, the Bank's self-help in setting off the Dailys' checking account reversed the mandated statutory procedure. In effect the Bank was attempting to collect the projected deficiency before the judicial foreclosure and before the court hearing at which the fair market value of the Carlsbad property was to be determined. As a practical matter, by its presale setoff action, the Bank reduced the likelihood it would even seek a later money judgment. This approach not only deprived the Dailys of their funds pending eventual judicial determination of the deficiency, if any, but it also reduced the Bank's incentive to seek the highest possible price for the Carlsbad property at the foreclosure sale. Although that defect could have been judicially corrected had the Bank later attempted to obtain a money judgment, the Bank's commercial decision in setting off the Dailys' checking account placed the entire financial burden pending foreclosure on the Dailys instead of on the Bank. That result is completely contrary to the primary purpose of section 726 of requiring secured creditors to exhaust their security before proceeding against their debtors. (Walker v. Community Bank, supra, 10 Cal.3d at pp. 735-736; McKean v. German-Am. Savings Bank, supra, 118 Cal. at pp. 339-341.) Thus, to allow the Bank's setoff action to go unsanctioned would have the effect of encouraging future violations of section 726, thereby diluting the statutory protections afforded debtors. Such a result would not only frustrate the Legislature's intent in enacting section 726, it also would contravene our Supreme Court's binding interpretation and application of that section. (Walker v. Community Bank, supra, 10 Cal.3d at pp. 733-734, 740-741.) We therefore hold that by taking its setoff action the Bank waived its right to foreclose the Carlsbad trust deed.
Consistent with this holding, the Dailys are entitled to attorney fees and costs incurred at trial and on appeal. (Civ. Code, § 1717, subd. (a); Leaf v. Phil Rauch, Inc. (1975) 47 Cal. App.3d 371, 379 [120 Cal. Rptr. 749]; American City Bank v. Zetlen (1969) 272 Cal. App.2d 65, 67 [61 Cal. Rptr. 311].)


*774 Disposition

The judgment of foreclosure of the Carlsbad property is reversed with instructions to the trial court to enter a judgment in favor of the Dailys. The court also is directed to award the Dailys such amounts as it determines are reasonable and necessary for attorney fees and costs incurred at trial and on appeal.
Brown (Gerald), P.J., and Work, J., concurred.
A petition for a rehearing was denied March 21, 1984, and respondent's petition for a hearing by the Supreme Court was denied May 23, 1984.
NOTES
[1]  All statutory references are to the Code of Civil Procedure unless otherwise specified.
[2]  Walker v. Community Bank (1974) 10 Cal.3d 729, 732-733, footnote 1 [111 Cal. Rptr. 897, 518 P.2d 329].
[3]  Robert A. Daily is referred to as a defendant for stylistic convenience only. He died on December 25, 1971, and his son, Richard A. Daily, was appointed administrator of his estate. The administrator is the named defendant in this case.
[4]  The trial below also involved a deed of trust on real property owned by the Dailys in Orange County. Since the court did not order foreclosure on that property, and the Bank has not cross-appealed from that part of the judgment, we do not discuss the facts pertaining to the Orange County property.
[5]  The Dailys' checking account is a general deposit account. (Kruger v. Wells Fargo Bank (1974) 11 Cal.3d 352, 358, fn. 5 [113 Cal. Rptr. 449, 521 P.2d 441, 65 A.L.R.3d 1266].) The Bank's charge against the Dailys' account represented an exercise of the Bank's equitable right of setoff rather than its statutory banker's lien. (Id., at pp. 357-358.)
