
234 Cal.App.3d 1539 (1991)
1 Cal. Rptr. 35
JOHN WALSH et al., Plaintiffs and Appellants,
v.
NEW WEST FEDERAL SAVINGS AND LOAN ASSOCIATION et al., Defendants and Respondents.
Docket No. D011477.
Court of Appeals of California, Fourth District, Division One.
September 13, 1991.
*1541 COUNSEL
Anderson & Kriger, Clayton M. Anderson and Charles A. Bott for Plaintiffs and Appellants.
Brown & Wood, Richard B. Schreiber, Michael S. Danko and Thomas G. Wood for Defendants and Respondents.
OPINION
WIENER, J.
Plaintiffs John Walsh and Sydney Walsh appeal from the judgment in favor of defendant New West Federal Savings & Loan Association (New West). New West cross-appeals from the court's denial of its motion for reasonable attorney's fees pursuant to Civil Code section 1717. We affirm the judgment and reverse the order denying New West attorney's fees.

FACTUAL AND PROCEDURAL BACKGROUND

I
The case comes to us after a court trial on New West's defense which was severed from the main action. For purposes of this appeal we therefore assume the truth of the allegations of the Walshes' complaint.
In 1982 the Walshes owned approximately 15 real properties, many of which were in default, nearing foreclosure. In attempting to extricate themselves from their financial difficulties, they met defendant Richard Gallegos who was allegedly going to solve their problems. They would deed their properties to him in exchange for $5,000 cash and Gallegos's promise to transfer to them property owned by defendant State Savings and Loan Association. The savings and loan property consisted of REO's, i.e., "real estate owned" by the bank, generally undesirable properties to retain because of the adverse effect on the bank's capital requirements. In addition, Gallegos agreed to give the Walshes three promissory notes totalling $5 million, secured by a second deed of trust on land owned by Gallegos on which he was constructing an office building (the Scripps Mesa Project). The loan by State Savings, the construction lender on the Scripps Mesa Project, was secured by a first deed of trust.
For reasons which are not clear, Gallegos was unable to convince State Savings to exchange the Walshes' former properties for bank-owned property.[1]*1542 Gallegos later lost the properties previously owned by the Walshes when the trust deed holders on the properties foreclosed. In addition, Gallegos was unsuccessful in developing the Scripps Mesa Project, resulting in State Savings foreclosing on its first trust deed, thus causing the Walshes to lose their security interest in that property. Gallegos paid nothing on the $500,000 secured note to the Walshes and later declared bankruptcy.

II
Seeking legal and equitable relief, the Walshes sued Gallegos and State Savings alleging fraud, conspiracy to defraud, and breach of contract. The purported liability of State Savings was predicated on the Walshes' allegations Gallegos served as its agent and/or that State Savings was a coconspirator with Gallegos.
Later the Federal Home Loan Bank Board (FHLBB) declared State Savings[2] to be insolvent and appointed the Federal Savings and Loan Insurance Corporation (FSLIC) as receiver. FSLIC took possession of all the assets of State Savings, ultimately resulting in a transfer of substantially all its asserts and liabilities, including the Walshes' litigation, to New West.

III
Soon after it became the real party in interest, New West raised as a defense a federal doctrine, known as the D'Oench Duhme[3] doctrine and its statutory counterpart, 12 United States Code section 1823(e).[4] The parties *1543 thereafter stipulated to sever the D'Oench Duhme defense for trial and to stay the remaining issues pending final resolution (including appeals) of the first trial.
The trial proceeded in two stages. First, the parties asked the court to determine whether the D'Oench Duhme doctrine applied to the facts of the case, presenting the question as a purely legal issue. After reviewing the parties' written submissions and hearing oral argument, the court concluded the doctrine did apply to the circumstances of the case. The court then provided the Walshes the opportunity to present facts showing they satisfied the requirements of the doctrine. In response, the Walshes admitted they were unable to come forward with such factual showing.[5] The court consequently entered judgment in favor of New West. This appeal ensued.

DISCUSSION

THE WALSHES' APPEAL

The D'Oench Duhme Doctrine
The D'Oench Duhme doctrine, an equitable rule of estoppel, emanates from the United States Supreme Court decision in D'Oench, Duhme & Co. v. F.D.I.C., supra, 315 U.S. 447. In D'Oench Duhme, the Federal Deposit Insurance Corporation (FDIC) sued on a promissory note which had been assigned to it in connection with a bank failure. In defense, the obligors alleged the bank had orally agreed it would not call the note for payment. Rejecting the defense, the Supreme Court held an obligor who "lent himself to a scheme or arrangement" that was "likely to... misle[a]d" bank examiners may not assert against the FDIC any part of an agreement that might diminish the value of his written loan obligation. (Id. at p. 460 [86 L.Ed. at pp. 963-964].) The Supreme Court based its ruling on a "federal policy ... to protect [the FDIC], ... from misrepresentations made to induce or influence [its] action[s], including misstatements as to the genuineness or integrity of securities in the portfolios of banks which it insures or to which it makes loans." (Id. at p. 459 [86 L.Ed. at p. 963].) Congress thereafter codified the doctrine at 12 United States Code section 1823(e).[6] (See fn. 4, ante, p. 1542.)
*1544 Since its inception, courts have dramatically expanded the reach of the common law doctrine and its statutory counterpart. (Beighley v. Federal Deposit Ins. Corp., supra, 868 F.2d at p. 784; Bowen v. Federal Deposit Ins. Corp. (5th Cir.1990) 915 F.2d 1013, 1015.) "The doctrine has been expanded to encompass any claim against an insolvent institution that would either diminish the value of the assets held by the FSLIC or increase the liabilities of the insolvent institution." (Castleglen, Inc. v. Commonwealth Sav. Ass'n (D.Utah 1989) 728 F. Supp. 656, 671, citing First State Bank v. City and County Bank (6th Cir.1989) 872 F.2d 707, 716-717.) The doctrine applies, for example, not only to defensive use of alleged oral promises (such as in the original D'Oench Duhme case), but also to offensive use, such as fraud or breach of contract claims based upon alleged oral agreements. (Beighley v. Federal Deposit Ins. Corp., supra, 868 F.2d at pp. 783-785; Webb v. Superior Court, supra, 225 Cal. App.3d 990.) Courts hold the defense applies, moreover, even where the party asserting an oral agreement was innocent of any wrongdoing. The relevant question is not whether the oral "agreement was itself fraudulent or whether the borrower intended to deceive banking authorities, but rather whether the borrower `lent himself to a scheme or arrangement' whereby [the] authorities were likely to be misled." (Bell & Murphy & Assoc. v. Interfirst Bank Gateway (5th Cir.1990) 894 F.2d 750, 753-754.)
As the Supreme Court recently explained, a primary purpose of the doctrine "is to allow federal and state bank examiners to rely on a bank's records in evaluating the worth of the bank's assets." (Langley v. FDIC (1987) 484 U.S. 86, 91 [98 L.Ed.2d 340, 347, 108 S.Ct. 396].) Such evaluations must frequently "be made `with great speed, usually overnight, in order to preserve the going concern value of the failed bank and avoid an interruption in banking services.' Gunter v. Hutcheson, 674 F.2d at 865." (Ibid.) The doctrine also seeks to "ensure mature consideration of unusual loan transactions by senior bank officials, and prevent fraudulent insertion of new terms, with the collusion of bank employees, when a bank appears headed for failure." (Id. at p. 92 [98 L.Ed.2d at p. 347].) Thus, "`[t]he doctrine encourages debtors to memorialize all agreements in writing and reflects the equitable principle that losses incurred as a result of unrecorded arrangements should not fall on deposit insurers, depositors, or creditors but rather upon the person who could have best avoided the loss.'" (Webb v. Superior Court, supra, 225 Cal. App.3d at p. 995, quoting Fair v. NCNB Texas Nat. Bank (N.D.Tex. 1990) 733 F. Supp. 1099, 1103.)


*1545 APPLICATION OF D'OENCH DUHME DOCTRINE
(1) Admittedly this case does not fit within the usual pattern into which a D'Oench Duhme defense is generally asserted. The Walshes do not allege a borrower/lender relationship between themselves and State Savings. Moreover, the focus of their action is not the enforceability of a promissory note to which they made a contemporaneous oral agreement. Nonetheless, mindful of the federal court's expansive interpretations of the doctrine and consistent with the authorities cited above, we conclude this case comes within the D'Oench Duhme doctrine because (1) the Walshes are attempting to enforce an oral agreement (their property exchange agreement with Gallegos) and/or to recover for oral misrepresentations made by Gallegos in connection with that agreement (2) which would reduce the value of assets formerly held by State Savings.
The Walshes counter the doctrine is inapplicable because there was never any agreement or relationship between them and State Savings. We agree the D'Oench Duhme doctrine generally bars enforcement of obligations only when those obligations arise from an agreement, as the term has been broadly construed by the courts (see Langley v. FDIC, supra, 484 U.S., at pp. 90-92 [98 L.Ed.2d at pp. 346-348]) and the Walshes had no direct relationship with New West. A direct relationship, however, is not an essential prerequisite to the applicability of the defense. (See Chatham Ventures, Inc. v. Federal Deposit Ins. Corp. (5th Cir.1981) 651 F.2d 355, 360-361; see also Federal Deposit Ins. Corp. v. Nixon (E.D.Mich. 1988) 681 F. Supp. 408 [holding defense applied even though misrepresentations were made by third party and not by bank].)
More significantly, the predicate of New West's liability as alleged in the Walshes' complaint is that State Savings acted as a coconspirator or in a principal/agency relationship with Gallegos.[7] Assuming these allegations are true, the lack of a direct relationship is irrelevant. A coconspirator is liable as a joint tortfeasor "irrespective of whether or not he was a direct actor and regardless of the degree of his activity." (Younan v. Equifax Inc. (1980) 111 Cal. App.3d 498, 508 [169 Cal. Rptr. 478].) Likewise a principal is liable to *1546 all persons who have relied upon an agent's ostensible authority, regardless of the lack of contact between the third party and the principal. (See Civ. Code, § 2334.) The Walshes' attempts to recover for Gallegos's failure to fulfill his promise to transfer certain of the bank's properties to them, for their loss of a security interest in the Scripps Mesa Project, and for fraudulent representations allegedly made by Gallegos are unquestionably derived from the property exchange agreement between the Walshes and Gallegos, for which New West is alleged to be liable as a principal or coconspirator. Therefore despite the lack of a direct relationship between State Savings and the Walshes, the D'Oench Duhme doctrine applies to bar the Walshes' claims.
Alternatively, the Walshes say the doctrine is inapplicable because their claims were of public record when the FSLIC was appointed receiver. The United States Supreme Court recently rejected a similar argument, holding the federal regulators' knowledge of a plaintiff's claim at the time of the receivership is irrelevant to the application of the D'Oench Duhme doctrine. (Langley v. FDIC, supra, 484 U.S. at pp. 94-95 [98 L.Ed.2d at p. 349].) Following Langley, the courts have "uniformly rejected" the argument that D'Oench is inapplicable when plaintiff's suit was on file at the time of a receivership. (Royal Bank of Canada v. Federal Deposit Ins. Corp. (N.D. Tex. 1990) 733 F. Supp. 1091, 1097; see also Webb v. Superior Court, supra, 255 Cal. App.3d at pp. 996-997; First State Bank v. City and County Bank, supra, 872 F.2d at p. 717; First City Nat. Bank v. Federal Dep. Ins. Co. (E.D.N.Y. 1990) 730 F. Supp. 501.)[8]

NEW WEST'S CROSS-APPEAL

Attorney's Fees
(2) Relying on the attorney's fee provision in the promissory notes between Gallegos and the Walshes, New West contends the court erred in denying their postjudgment motion for reasonable attorney's fees pursuant to Civil Code section 1717.[9]
Civil Code section 1717 permits recovery of reasonable attorney's fees in contract actions, where recovery of such fees is expressly provided in the *1547 contract. The Walshes concede the enforceability or validity of a contract is not a factor in determining whether a party may recover attorney's fees under a contract. (See Reynolds Metals Co. v. Alperson (1979) 25 Cal.3d 124, 128-129 [158 Cal. Rptr. 1, 599 P.2d 83].)
The Walshes argue Civil Code section 1717 is inapplicable "because no contract causes of action were alleged against New West," directing us to Stout v. Turney (1978) 22 Cal.3d 718. In Stout the court held "[a] tort action for fraud arising out of a contract is not ... an action `on a contract' within the meaning of ... [Civil Code] section [1717]." (Id., at p. 730.) Whether a particular action is "on a contract" turns on the allegations contained in the plaintiff's pleadings. (Manier v. Anaheim Business Center Co. (1984) 161 Cal. App.3d 503, 508 [207 Cal. Rptr. 508].) Here, the Walshes' complaint makes clear they alleged a fraud and breach of contract claim against New West. As the trial court observed, "the allegations in plaintiffs' complaint ... assert that defendant New West was liable for the contractual obligations and fraudulent conduct of defendant... Gallegos by reason of an alleged conspiratorial agreement and an agency agreement between New West and Gallegos." (Italics added.) Moreover, even if a breach of contract is not specifically pleaded, an action may be "on a contract" where, as here, the contract claim is asserted during trial "and the [contract] theory.... [is] well known to court and counsel." (Bruckman v. Parliament Escrow Corp. (1987) 190 Cal. App.3d 1051, 1060 [235 Cal. Rptr. 813].) In their pretrial motions, the Walshes acknowledged their suit against New West was for "for fraud, conspiracy to defraud, constructive trust, specific performance and breach of contract." The Walshes' breach of contract cause of action against New West falls within the purview of section 1717.
The Walshes further argue New West's request for attorney's fees was "premature" because a final decision had not yet been "rendered on appeal." The argument is inconsistent with statutory authority requiring a prevailing party to move for attorney's fees as an item of cost within a specified period of time after the court enters an order or judgment. (See Civ. Code § 1717 ["the court, upon notice and motion by a party, shall determine who is the party prevailing on the contract" and shall award to the prevailing party reasonable attorney's fees as "an element of the costs of suit"]; see also California Rules of Court, rule 870.2 [a motion to claim fees as an element of costs under section 1717 "shall be served and filed before or at the same time the memorandum of costs is served and filed"].) The Walshes' reliance on Mabee v. Nurseryland Garden Centers, Inc (1979) 88 Cal. App.3d 420 [152 Cal. Rptr. 31] and Presley of Southern California v. Whelan (1983) 146 Cal. App.3d 959 [196 Cal. Rptr. 1] is misplaced. The Mabee court found the *1548 plaintiff was not entitled to recover as a "prevailing party" under section 1717 until the appeal had been resolved in his favor, relying upon statutory language that a party is not entitled to recover attorney's fees until a final judgment was rendered. After that case was decided, however, section 1717 was amended to delete any requirement that a final judgment be entered before fees can be awarded. Civil Code section 1717(b)(1), as it now reads, expressly provides "[t]he court ... shall determine who is the party prevailing ... whether or not the suit proceeds to final judgment."
Presley of Southern California v. Whelan, supra, 146 Cal. App.3d 959, is likewise inapposite. There, the defendant moved successfully for summary judgment. On appeal, the court reversed the judgment, ruling that the case involved triable issues of fact. After the appeal but prior to trial, the plaintiff moved for reasonable attorney's fees incurred on appeal, pursuant to Civil Code section 1717. This court held the plaintiff was not yet entitled to fees since "[t]here must be a prevailing party before the fee provision applies, and no one has yet prevailed here." (146 Cal. App.3d at p. 961.) In this case, by contrast, the court's judgment is final and there is no question that New West is the prevailing party.

DISPOSITION
The judgment is affirmed. The case is remanded to allow the trial court to determine New West's reasonable attorney's fees.
Kremer, P.J., and Work, J., concurred.
A petition for a rehearing was denied October 8, 1991, and appellants' petition for review by the Supreme Court was denied January 16, 1992.
NOTES
[1]  While the complaint does not specify why Gallegos was unsuccessful, in their brief the Walshes assert "[w]hen Gallegos submitted the plaintiffs' properties to State Savings, ... only one of the 15 properties was accepted. In return for that property, State Savings offered Gallegos horribly maintained REO properties in depressed neighborhoods scattered throughout California."
[2]  By that time, American Savings and Loan Association had succeeded to the assets and liabilities of State Savings. For convenience, however, we will continue to refer to the insolvent entity as State Savings.
[3]  D'Oench, Duhme & Co. v. F.D.I.C. (1942) 315 U.S. 447 [86 L.Ed. 956, 62 S.Ct. 676].
[4]  12 United States Code section 1823(e) provides:

"No agreement which tends to diminish or defeat the interest of the [Federal Deposit Insurance] Corporation in any asset acquired by it ... either as security for a loan or by purchase or as receiver of any insured depository institution, shall be valid against the [Federal Deposit Insurance] Corporation unless such agreement  [¶] (1) is in writing, [¶] (2) was executed by the depository institution and any person claiming an adverse interest thereunder, including the obligor, contemporaneously with the acquisition of the asset by the depository institution, [¶] (3) was approved by the board of directors of the depository institution or its loan committee, which approval shall be reflected in the minutes of said board or committee, and [¶] (4) has been, continuously, from the time of its execution, an official record of the depository institution."
[5]  In this regard, counsel for the Walshes stated: "Your Honor, [you gave us] an opportunity to appear today to offer evidence to show compliance with 12 U.S.C. Section 1823(e).

"Insofar as the agreements that the plaintiffs must show compliance based on ostensible agency and conspiracy to defraud, the plaintiffs do not feel they can at this time offer evidence to show compliance. Therefore, the plaintiffs respectfully submit to the tentative ruling with the understanding that it will result in a final [judgment]."
[6]  While the express words of the statute apply exclusively to the FDIC, the statute's rationale "`has been uniformly extended to the [FSLIC] and the savings and loan industry....' (Federal Sav. and Loan Ins. Corp. v. Locke (W.D. Tex. 1989) 715 F. Supp. 573, 582, and cases cited there.)" (Webb v. Superior Court (1990) 225 Cal. App.3d 990, 999 [275 Cal. Rptr. 581].) Courts generally "consider the D'Oench doctrine and section 1823(e) in tandem, looking to the common law when construing the statute" (Beighley v. Federal Deposit Ins. Corp. (5th Cir.1989) 868 F.2d 776, 785) and relying upon judicial interpretations of the statute when applying the common law.
[7]  In their opening brief the Walshes state their claims against Gallegos and State Savings are based upon an alleged "ostensible agency relationship" between the two defendants. In their reply brief, the Walshes say their "complaint against New West only alleges a tort cause of action for conspiracy to defraud." (Italics added.) Because our conclusion would be the same regardless whether State Savings is alleged to be liable on an agency theory or a conspiracy theory, this inconsistency is immaterial to our analysis. For purposes of this appeal we assume the truth of the Walshes' agency and conspiracy allegations, because the parties made such assumption in conducting the bifurcated trial and because absent the truth of such allegations the Walshes could not state any cause of action against the bank, with whom they admit they had "no contact."
[8]  The Walshes' reliance upon Woodbridge Plaza v. Bank of Irvine (9th Cir.1987) 815 F.2d 538 and First Empire Bank v. Federal Deposit Ins. Corp. (9th Cir.1978) 572 F.2d 1361 is misplaced since those decisions did not involve a consideration of the D'Oench Duhme defense.
[9]  Civil Code section 1717 provides as follows: "(a) In any action on a contract, where the contract specifically provides that attorney's fees and costs, which are incurred to enforce that contract, shall be awarded ... to one of the parties ..., then the party who is determined to be the party prevailing on the contract, whether he or she is the party specified in the contract or not, shall be entitled to reasonable attorney's fees..."
