
184 Cal.App.3d 860 (1986)
229 Cal. Rptr. 305
NORTH ASSOCIATES, Plaintiff and Respondent,
v.
ROBERT Y. BELL, Defendant and Appellant.
Docket No. A028762.
Court of Appeals of California, First District, Division Three.
August 22, 1986.
*861 COUNSEL
Charles M. Giovanetti for Defendant and Appellant.
John D. Flitner and Foster, Monroe, Flitner & Buchanan for Plaintiff and Respondent.
OPINION
MERRILL, J.
Robert Y. Bell (Bell) appeals from a postjudgment order determining that respondent North Associates (North) was entitled to attorney's fees as the prevailing party in its action for unlawful detainer. We affirm.

I
At all relevant times, North was the owner of real property located at 858 Third Street, Santa Rosa. On March 13, 1981, Bell entered into a commercial lease agreement with North for the use and possession of the property. The lease was for a period of six months, commencing on March 15, 1981, and ending September 14, 1981. It contained an option to renew for a six-month period beginning on September 15, 1981, and ending March 14, 1982. In addition, the lease contained a "hold over" provision stating *862 that "[a]ny holding over after the expiration of this lease, with the consent of Lessor, shall be construed as a month-to-month tenancy at a rental of $1,200.00 per month, otherwise in accordance with the terms hereof, as applicable." Finally, the lease contained the following attorney fees provision: "In case suit should be brought for recovery of the premises, or for any sum due hereunder, or because of any act which may arise out of the possession of the premises, by either party, the prevailing party shall be entitled to all costs incurred in connection with such action, including a reasonable attorney's fee."
On August 6, 1981, Bell notified North in writing of his intention to exercise the option to extend the lease for six months. This extension period ended on March 14, 1982. Nevertheless, Bell continued to occupy the premises from month to month, and the parties entered into correspondence to negotiate a new lease.
On April 16, 1982, Paul T. Reynolds, a general partner in North, sent Bell a letter in which North offered Bell a new one-year lease for the period of March 15, 1982, through March 14, 1983, at a monthly rental of $1,100. This proposed lease was on a form identical to the original lease except for the proposed rent and the dates thereof; it included an attorney fees provision, a hold-over provision, and an option to extend the lease for two years from March 14, 1983, through March 14, 1985, with rents increasing to $1,200 and $1,300 per month for those optional years. On April 30, 1982, Reynolds sent Bell a letter pointing out that Bell's rental payments to North were $1,350 in arrears.
In a letter dated May 12, 1982, Bell sent North checks to cover the arrearages; made a counterproposal for a $200 reduction for the first six months of the rental payments called for in North's proposed lease; and suggested adding an option to extend the lease for a third year at a rental rate of $1,400 per month. Bell wrote: "As to the rest of the terms of the lease, I am in the process of reviewing them this week and will give you any suggested language changes in a few days." Two days later, on May 14, 1982, Reynolds wrote to Bell as follows: "I discussed your proposal on rent adjustment for the first six months of 1982 at $900.00 per month with my partners. We are agreeable to holding the rent at the present level of $1000.00 per month for the first 6 months of 1982 and I understand in talking with you, this is acceptable to you.... After you have completed reviewing the lease terms, give me a call and we can get together to discuss it."
The proposed form of lease was never executed; nevertheless, Bell continued to occupy the premises. On April 12, 1983, North served Bell with *863 a 30-day notice to quit the premises, announcing North's intention to institute legal proceedings to recover unpaid rent and possession of the property. When Bell refused to leave the premises, North filed the instant action for unlawful detainer, incorporating by reference the original March 1981 lease, and including a request for attorney fees pursuant to the terms of the lease. In his answer, Bell denied the allegation in North's complaint that "[n]o additional written extensions or written renewals of the [March 1981] lease agreement have been granted" since Bell's exercise of his option to extend the lease six months to March 14, 1982; denied the allegation that he had "held over on a month-to-month basis"; and contended "that annual extensions have been granted to him and that [North] has waived and is estopped from asserting its claims on the present notice [to quit]."

II
Following a court trial, the trial judge issued a tentative decision finding as follows: the March 1981 lease agreement expired on March 14, 1982; "[a]lthough a formal lease ... was never executed between the parties, the exchanged memoranda ..., coupled with the payment by Bell and the acceptance by North of rents, created a new lease for the period of March 15, 1982, to March 14, 1983, at a monthly rental of $1,000.00 per month from March 15, 1982, to September 14, 1982, and at a monthly rental of $1,100.00 per month from September 15, 1982, to March 14, 1983"; this "new lease" terminated on March 14, 1983; the memoranda evidencing the "new lease" are "insufficient to overcome the statute of frauds re the lease carrying a term of over one year"; and "even if the lease contained options on behalf of Bell to extend for two additional years at $1,200.00 and $1,300.00 per month respectively Bell failed to exercise the option for the following year either in writing or by agreement of the parties or by operation of law"; in March 1983, "after the option period should have been in effect, Bell paid rent of $1,100.00, not $1,200.00 as would have been necessary had he intended to exercise the option"; and from March 15, 1983, until the date of trial "Bell has been a hold over tenant on the property without the consent of North, and North had a valid right to terminate Bell's occupancy thereafter."
The court entered judgment[1] awarding North restitution and possession of the subject property, unpaid rent, damages for Bell's failure to vacate the premises, and "costs of suit." On that same date, counsel for North submitted a memorandum of costs and disbursements including $5,615 in attorney fees. Bell filed a motion to "retax costs," contending that the attorney fees sought by North were "not legally chargeable as costs."
*864 After a hearing on this motion, the trial court issued an "order re costs" awarding attorney fees to North in the requested amount. The court found that an award of attorney's fees was proper because of decisional law interpreting Civil Code section 1717 to require that a party be awarded attorney fees when the opposing party would clearly have been entitled to attorney fees should he or she have prevailed in enforcing a disputed contractual obligation against the first party. Since Bell based his defense on allegations of "written annual extensions" of the original March 1981 lease, which contained an attorney fees provision, he would have been entitled to such fees had he been successful in this defense. The court concluded that because North would have been liable for Bell's attorney fees had its action been successfully defended by Bell on the basis alleged in Bell's pleadings, "North as prevailing party herein may likewise recover attorney's fees now that it has prevailed." The court denied Bell's motion to tax costs and awarded attorney fees to North as part of costs. This appeal followed.

III
(1a) The sole issue on appeal is the validity of the trial court's award of attorney fees to North. Bell asserts that the court erred in applying Civil Code section 1717 to this case because the only attorney fees provision in any written agreement between the parties was the reciprocal attorney fees clause in the March 1981 lease, which the trial court determined expired or was terminated on March 14, 1982. Bell contends that because the trial court found a new contract was created between the parties by virtue of their correspondence and other memoranda, there is no attorney fees provision to form the basis for an award of attorney fees. We disagree.
The issues raised by Bell's appeal are controlled by two statutes and the decisional law applying them in situations similar to the instant case. Section 1021 of the Code of Civil Procedure states: "Except as attorney's fees are specifically provided for by statute, the measure and mode of compensation of attorneys and counselors at law is left to the agreement, express or implied, of the parties; but parties to actions or proceedings are entitled to costs and disbursements, as hereinafter provided." In pertinent part, section 1717 of the Civil Code 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."
*865 Bell concedes that numerous appellate decisions have applied section 1717 to award attorney fees to prevailing parties even in situations where the contract containing the attorney fees provisions is unenforceable, rescinded, or nonexistent, or where the party sued on a contract is actually a nonsignatory. (Reynolds Metals Co. v. Alperson (1979) 25 Cal.3d 124, 128-130 [158 Cal. Rptr. 1, 599 P.2d 83]; Jones v. Drain (1983) 149 Cal. App.3d 484, 486-490 [196 Cal. Rptr. 827]; Care Constr., Inc. v. Century Convalescent Centers, Inc. (1976) 54 Cal. App.3d 701, 705-707 [126 Cal. Rptr. 761].) However, he argues that the rationale used by the courts in these cases only applies in situations where parties of superior bargaining power have inserted one-sided attorney fees provisions into their contracts.
Bell's argument misconstrues the actual rationale of the cited cases. (2) They are based not on the question of whether the language of a given attorney fees provision is or is not reciprocal, but on the fundamental purpose of section 1717 to insure mutuality of a prevailing party's access to an award of attorney fees. As long as an action "involves" a contract, and one of the parties would be entitled to recover attorney fees under the contract if that party prevails in its lawsuit, the other party should also be entitled to attorney fees if it prevails, even if it does so by successfully arguing the inapplicability, invalidity, unenforceability, or nonexistence of the same contract. (Reynolds Metals Co. v. Alperson, supra, 25 Cal.3d at pp. 128-129; Jones v. Drain, supra, 149 Cal. App.3d at pp. 486-490; Care Constr., Inc. v. Century Convalescent Centers, Inc., supra, 54 Cal. App.3d at pp. 705-707.) As stated in Jones v. Drain, supra, 149 Cal. App.3d at pages 489-490: "The courts have consistently held that the award of Civil Code section 1717 contractual attorney's fees is to be governed by equitable principles. [Citations.] 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. As a consequence, we find that a prevailing defendant sued for breach of contract containing an attorney's fees provisions and having had to defend the contract cause of action is entitled to recover its own attorney's fees and costs therefor, even though the trial court finds no contract existed."
(1b) We perceive no substantive distinction between the cited cases and the instant one. Here, North brought suit on a written lease agreement containing an attorney fees provision; Bell defended by alleging that he had been granted extensions under the same written lease. Had Bell been successful in making this defense, he would have been entitled to attorney fees under the original lease.[2] North prevailed in the lawsuit, although the trial *866 court found that the original lease had expired and a new lease had taken its place by virtue of the exchanged memoranda and conduct of the parties. It would be inequitable to deny attorney fees to North, the prevailing party, when Bell would have been entitled to an award of attorney fees had he prevailed under the same facts. In short, Bell's contention in his pleadings and at trial that his continued occupancy of the subject premises was under an extension of the original lease, which lease provided for attorney fees for the prevailing party in any dispute thereon, provides ample justification for the trial court's award of attorney fees to North, even though the court found that the original lease was no longer in effect at the time of Bell's eviction.

IV
In addition, there may be more than one basis for the granting of a judgment. We note that the trial court never rendered a decision that there was no attorney fees provision in effect at the time of Bell's eviction. Bell makes much of the fact that the trial court's tentative decision found that the March 1981 lease had expired on March 14, 1982, and was replaced by a one-year agreement evidenced only by the parties' exchange of memoranda and North's acceptance of rents. Because there was no express agreement in the correspondence between the parties for an attorney fees clause, Bell insists that there was no agreement regarding attorney fees in effect after the March 1981 lease terminated. However, a reciprocal attorney fees provision was included in the proposed form of lease which North sent to Bell in April 1982 when the first lease expired and negotiations on the parties' future relationship commenced. The parties continued to refer to this proposed lease in their ensuing correspondence. Although it was never signed, the proposed lease, along with this correspondence, constitute the evidence to support Bell's assertion, made at trial and discussed in the trial court's tentative decision, that he was "holding over" in reliance on an agreement to create a new lease in 1982 extendable at his option for another two years. There is simply no basis for Bell's assertion that the unexecuted proposed lease's optional extension provisions were included in the parties' "lease agreement," but that the reciprocal attorney fees provision in that same proposed lease was not so included. Not only Bell's arguments at trial, but his behavior in making monthly rental payments on the property and in purportedly attempting to exercise an option to extend, evidences a reliance by both parties on the terms of the unexecuted proposed lease repeatedly referred to in their correspondence.
*867 Furthermore, the determination of the trial court that the "new lease" terminated on March 14, 1983, did not preclude a finding that there was a holding over on a basis of a provision in that lease that any holding over shall be construed as "a month-to-month tenancy ... otherwise in accordance with the terms hereof, as applicable," in which case the provision in respect to attorney fees was still in effect at the time of the eviction.

V
(3) It is well established that equitable principles govern an award of attorney fees pursuant to section 1717. (1c) We conclude that in light not only of Bell's claim of extension under the March 1981 lease, but his implicit reliance on terms contained in the unexecuted proposed lease of April 1982 and the court's finding that there was a "new lease," it would be inequitable not to find that North was entitled to attorney fees under the reciprocal attorney fees provisions contained in both the original lease and the "new lease."
The judgment is affirmed.
White, P.J., and Barry-Deal, J., concurred.
NOTES
[1]  The trial court did not issue a statement of decision as no request for one was made prior to submission of the matter for decision, and the trial lasted less than one day.
[2]  The fact that Bell did not seek attorney fees in his answer to the first amended complaint is not material, since the lack of such a prayer would not have barred him from recovery if he had prevailed. (Martin v. Pacific Southwest Royalties (1940) 41 Cal. App.2d 161, 172 [106 P.2d 443].)
