
161 Cal.App.3d 503 (1984)
207 Cal. Rptr. 508
JOHN D. MANIER et al., Plaintiffs and Respondents,
v.
ANAHEIM BUSINESS CENTER COMPANY et al., Defendants and Appellants.
Docket No. 30226.
Court of Appeals of California, Fourth District, Division Three.
October 31, 1984.
*504 COUNSEL
John W. Powell for Defendants and Appellants.
Walker & Hartley, Dalton & Hartley and Les J. Hartley for Plaintiffs and Respondents.
OPINION
CROSBY, J.
The prevailing defendants in a specific performance and breach of contract action appeal a postjudgment order denying their motion for attorneys fees (Civ. Code, § 1717).


*505 I
On May 11, 1979, plaintiff John Manier executed a "Real Estate Purchase Agreement and Deposit Receipt" to acquire commercial property owned by defendant Anaheim Business Center Company (ABCC). Defendant Eric Martens, ABCC's president and general partner, signed the document on behalf of the company. Martens added the following handwritten note at the end of the signature page: "Seller's acceptance of this offer is subject [to] and contingent upon buyer's execution of escrow instructions in form and content satisfactory to seller." Manier never initialed these additional terms. Escrow opened and instructions were filed on May 24, 1979.
ABCC cancelled the agreement on May 19, 1980, citing the Maniers' failure to arrange acceptable permanent financing. The Maniers then sued for specific performance, breach of contract, injunctive relief, and attorneys fees, claiming defendants agreed to assist them in obtaining financing. The court found no such obligation, and ABCC and Martens prevailed at trial. The defendants then sought to recover attorneys fees based on paragraph 6(d) of the deposit receipt[1] and Civil Code section 1717.[2] They claimed to have incurred $81,520 in attorneys fees in defending the Maniers' action. The court held Martens' handwritten changes constituted a counteroffer which the Maniers never accepted.[3] The court concluded there was no contract and, thus, no right to attorneys fees under Civil Code section 1717. ABCC and Martens appeal.

II
The Maniers, who sued on the contract, now insist Civil Code section 1717 does not apply because the court ruled no enforceable contract existed between the parties. They argue mere allegations by a plaintiff of entitlement to attorneys fees are insufficient to invoke Civil Code section 1717 if the court determines the contract never existed. They are wrong. (1) The *506 existence of an enforceable agreement is not a prerequisite to an award of attorneys fees under Civil Code section 1717. That section is available even where the prevailing party succeeds on the theory there was never an enforceable contract. (Reynolds Metals Co. v. Alperson (1979) 25 Cal.3d 124 [158 Cal. Rptr. 1, 599 P.2d 83].)
In Care Construction, Inc. v. Century Convalescent Centers, Inc. (1976) 54 Cal. App.3d 701 [126 Cal. Rptr. 761], the lessee defendant prevailed by proving a lease was invalid. The purported lease required the lessee to pay the lessor's attorneys fees in case of a dispute. The court applied Civil Code section 1717 and awarded the defendant reasonable attorneys fees: "as long as the action ... involved a contract it was `on a contract' and within ... section 1717." (Id., at p. 706.)
Care Construction relied in part on an earlier Court of Appeal opinion, Babcock v. Omansky (1973) 31 Cal. App.3d 625 [107 Cal. Rptr. 512]. In Babcock, both a husband and wife were sued on promissory notes signed by the husband alone. The plaintiffs alleged the wife was somehow liable as a "joint venturer" with her husband on notes she did not execute. Judgment was in her favor, and the Court of Appeal determined she was entitled to attorneys fees under Civil Code section 1717: "As the language of the statute expressly indicates, a party need not be a signatory to the contract in order to recover attorney's fees as the prevailing party  as such prevailing party he becomes entitled to fees `whether he is the party specified in the contract or not.'" (Id., at p. 633.)
A different panel of the Care Construction court disavowed any reliance on Babcock two years later, however: "Respondents do quite properly call to our attention the By the Court opinion of this court in Care Constr., Inc. v. Century Convalescent Centers, Inc. [supra] 54 Cal. App.3d 701, in which Babcock v. Omansky [supra] 31 Cal. App.3d 625 is cited as additional support for the decision. In our opinion in the case at bench, of course, we disagree[] with Babcock v. Omansky insofar as it indicated one who is not a party to a contract may recover attorney fees pursuant to the contract under Civil Code section 1717. [¶] ... Accordingly, that portion of the opinion in [Care Construction] citing [Babcock] as additional support is disapproved." (Canal-Randolph Anaheim, Inc. v. Wilkoski (1978) 78 Cal. App.3d 477, 496 [144 Cal. Rptr. 474].)
Ten months later, the Canal-Randolph panel appeared to retreat considerably in Pas v. Hill (1978) 87 Cal. App.3d 521 [151 Cal. Rptr. 98]. There, *507 the court explained, "we disagree with the Babcock court to the extent it interpreted the statutory language `the prevailing party, whether he is the party specified in the contract or not' as referring to a party to the litigation who was not a party to the contract or who was not at least claimed by the adversary party to be a party to the contract or obligated by its terms ...." (Id., at p. 534, italics added.) But the trial court's award of attorneys fees to the prevailing defendants in Canal-Randolph was reversed, although plaintiff claimed they were obligated by the terms of the lease, because defendants were not alleged to have been signatories, parties, or assignees.
The Pas court concluded, "it is not necessary to be a signatory to the contract to recover attorney fees under section 1717" (ibid.)  and this time conceded the result in Babcock was correct: "In our view the key to [Babcock] is that the plaintiffs who were parties to the promissory notes pleaded and attempted to prove that the defendant wife was a party to the notes or liable on the notes as a joint venturer and had the plaintiffs prevailed on that cause of action, [they] would have been entitled to an award of attorney fees against the defendant wife under the notes' unilateral attorney fee provisions. ... [T]he plaintiffs having ... caused defendant wife to defend against such liability, were estopped to deny defendant wife was a party to the contract for the remedial purposes of Civil Code section 1717. [Citations.]" (Id., at pp. 535-536.)
Thus, as to the attorneys fees issue, Canal-Randolph was effectively superseded and emasculated by Pas v. Hill, supra, 87 Cal. App.3d 521, which appears to us to state the better rule.[4] The prevailing party in an action based on a contract where the opposing party seeks attorneys fees under the agreement is entitled to recover his own fees pursuant to section 1717 whether the contract is upheld or whether the court determines the prevailing litigant was not a party or signatory to the contract or, as here, the contract is not enforceable. (Id., at pp. 535-536.)


*508 III
(2) Alternatively, the Maniers contend section 1717 does not apply because they would not have been entitled to attorneys fees had they prevailed. They argue, since the deposit receipt was ineffective to create a binding agreement, they could not have enforced it and would never have been awarded their attorneys fees based on it. Marne Manier also seeks refuge in the fact she was not a signatory to the deposit receipt. Both spouses now claim to have sued for damages for breach of the escrow instructions only and, as this document did not contain an attorneys fees provision, neither side may invoke section 1717. These arguments must fail for several reasons.
First, all four versions of plaintiffs' complaint were expressly based on the deposit receipt. A copy of that document was attached as an exhibit to and incorporated by reference in each of the verified pleadings; it provides for attorneys fees to the prevailing party (see fn. 1, ante). Thus the Maniers could have prevailed only by proving the viability of the deposit receipt.
Second, it matters not that they failed in this endeavor. Whether a party is entitled to attorneys fees for the purpose of invoking Civil Code section 1717 depends not on the evidence adduced at trial or some interim proceeding, but on the pleadings. This issue was recently addressed in Jones v. Drain (1983) 149 Cal. App.3d 484 [196 Cal. Rptr. 827], where the court noted, "even though the respondent possessed no evidence to support its cause of action it was capable of alleging sufficient facts in its pleadings to force the appellants to wage a defense." (Id., at p. 489.)
Here, both Maniers sued in the alternative for specific performance or damages for breach of contract and sought attorneys fees on all causes of action. They would have been entitled to attorneys fees if their complaint had merit, which it concededly did not. Consequently, Civil Code section 1717 mandates that result for prevailing parties ABCC and Martens. (Reynolds Metals Co. v. Alperson, supra, 25 Cal.3d 124; Jones v. Drain, supra, 149 Cal. App.3d 484; Berge v. International Harvester Co. (1983) 142 Cal. App.3d 152, 164 [190 Cal. Rptr. 815].)
Finally, it is of no moment that Marne Manier was not a signatory to the deposit receipt; she alleged entitlement to attorneys fees under it. We concur with the apt view of Justice Stone in Jones v. Drain, supra, 149 Cal. App.3d 484: "We believe that it is extraordinarily inequitable to deny a party who successfully defends an action on a contract, which claims attorney's fees, the right to recover its attorney's fees and costs simply because the party initiating the case has filed a frivolous lawsuit." (Id., at pp. 489-490.)
*509 The order denying attorneys fees is reversed. The matter is remanded to the trial court for a determination of appellants' attorneys fees at trial and on appeal.
Trotter, P.J., and Sonenshine, J., concurred.
A petition for a rehearing was denied November 14, 1984, and respondents' petition for a hearing by the Supreme Court was denied January 2, 1985.
NOTES
[1]  Paragraph 6(d) provides. "If any party to this agreement or the Broker institutes any legal action against any other party to this Agreement, the prevailing party in said action shall be entitled to a reasonable attorneys fee, in addition to any other judgment of the court."
[2]  Civil Code section 1717 provides, "(a) In any action on a contract, where the contract specifically provides that attorney's fees and costs, which are incurred to enforce the provisions of that contract, shall be awarded either to one of the parties or to the prevailing party, then the party who is determined to be the prevailing party, whether he or she is the party specified in the contract or not, shall be entitled to reasonable attorney's fees in addition to costs and necessary disbursements.

".... .... .... .... .... .... .
"Reasonable attorney's fees shall be fixed by the court, upon notice and motion by a party, and shall be an element of the costs of suit...."
[3]  The correctness of this finding has not been questioned on appeal.
[4]  The issue was again somewhat obscured the following year, however, in Reynolds Metals Co. v. Alperson, supra, 25 Cal.3d 124, where the Supreme Court heavily relied on Babcock v. Omansky, supra, 31 Cal. App.3d 625 in determining that Civil Code section 1717 "refers to `any action on a contract' thus including any action where it is alleged that a person is liable on a contract, whether or not the court concludes he is a party to that contract." (Id., at p. 128.) The court's opinion in Reynolds Metals failed to distinguish or disapprove Canal-Randolph and even cited it with apparent approval, although the holdings of the two cases appear irreconcilable. (See Reynolds Metals v. Alperson, supra. at p. 129.) This is doubly puzzling since one of the cases Canal-Randolph relied on. Arnold v. Browne (1972) 27 Cal. App.3d 386 [103 Cal. Rptr. 775], was specifically disapproved in Reynolds itself. (Ibid.)
