
175 Cal.App.4th 974 (2009)
JOE D. TURNER, Plaintiff and Appellant,
v.
GREGORY E. SCHULTZ et al., Defendants and Respondents.
Nos. A121642, A121707.
Court of Appeals of California, First District, Division Four.
July 13, 2009.
*976 Law Offices of Adam S. Gruen and Adam S. Gruen for Plaintiff and Appellant.
Bowles & Verna, Michael P. Verna and David W. Trotter for Defendant and Respondent Asset Allocation Advisors, Inc.
Law Offices of Glenn P. Walling and Glenn P. Walling for Defendants and Respondents Gregory E. Schultz and Bruce D. Grenke.

OPINION
RIVERA, J. 
Plaintiff Joe D. Turner appeals an award of attorney fees to defendants Asset Allocation Advisors, Inc. (the company), Gregory E. Schultz, and Bruce D. Grenke (collectively defendants) made after Turner unsuccessfully sought declaratory and injunctive relief to forestall the arbitration of the dispute between the parties. He contends that it is too early to determine a prevailing party, and that any award should be made by the arbitrator rather than the court. We conclude attorney fees were properly awarded in this discrete legal action.

I. BACKGROUND
This is the third time we have considered an appeal in this case. (Turner v. American Arbitration Assn. (Oct. 24, 2007, No. A112884) [nonpub. opn.] *977 (Turner I); Turner v. American Arbitration Assn. (Oct. 24, 2007, No. A113905) [nonpub. opn.] (Turner II).) We quote at length from our discussion of the facts in Turner I:[1]
Turner, a shareholder in the company, entered into a "Buy/Sell Agreement II" (the agreement) in 2003 with Schultz and Grenke, two other shareholders in the company. The agreement provided a formula for buying out the shares of a shareholder who was terminated as an employee of the company. The agreement also contained an arbitration clause, which provided in pertinent part: "[I]n the event any controversy or claims arising out [of] this Agreement cannot be settled by the parties hereto or their legal representatives, ... such controversy or claims shall be settled by arbitration in accordance with the then current rules of the American Arbitration Association and judgment upon the award may be entered in any Court having jurisdiction thereof." [] According to the complaint in this action, the company's board of directors terminated Turner's employment in 2004, and Turner was dissatisfied with the amount the company offered him for his shares. The company, Schultz, and Grenke demanded arbitration of the dispute[, describing it as one over "the interpretation and application of a buy/sell agreement as it relates to Turner's interest in Asset Allocation Advisors, Inc ...."]
Through his attorney, Turner took part in a discussion with a manager for defendant American Arbitration Association (the AAA) on June 10, 2005, and requested that arbitration take place in San Francisco. However, on June 28, 2005, he informed defendants that he refused to participate in the arbitration absent a court order compelling arbitration, taking the position that the agreement was void ab initio because it was procured by "fraud in the inception." The next day, the AAA notified the parties that it would proceed with the arbitration unless the parties agreed or a court ordered otherwise.
Turner filed an action against the company, Schultz, Grenke and another corporation in the Contra Costa County Superior Court on August 9, 2005 (Turner v. Schultz (2006, No. C-05-01521) (the Contra Costa action)), which included allegations that Grenke and Schultz made false representations to induce Turner to enter into the agreement. Nine days later, Turner wrote to the AAA, taking the position that the AAA lacked jurisdiction because Turner had filed his action in superior court. Turner also objected to the arbitrators proposed by the AAA because of that lack of jurisdiction. The AAA administratively appointed three arbitrators on August 22, 2005, and later confirmed the appointment.[]
*978 Turner brought the action that is the subject of this appeal against the AAA, Schultz, Grenke, and the company in the San Francisco Superior Court on September 20, 2005 (the San Francisco action). He sought a declaration that the defendants could not proceed with arbitration relating to the agreement without first obtaining a court order; he also sought an injunction requiring the AAA to stay its proceedings until the defendants obtained an order compelling arbitration pursuant to Code of Civil Procedure section 1281.2 (section 1281.2).
Turner then filed an application in the San Francisco action for a temporary restraining order and order to show cause, seeking a preliminary injunction prohibiting defendants from "taking any action concerning the American Arbitration Association arbitration entitled Bruce Grenke and Gregory Schultz and Asset Allocation Advisors, Inc. vs. Joe Turner, 74 168 Y 00529 05 DEAR, other than dismissing that arbitration, unless an order compelling arbitration is issued." The trial court denied the temporary restraining order, but issued an order to show cause. After further briefing and a hearing, the trial court denied Turner's application on November 7, 2005. Turner filed his notice of appeal [in Turner I] on January 5, 2006.
Meanwhile, on December 21, 2005, the company, Schultz, and Grenke filed a petition to compel arbitration in the Contra Costa action. Turner opposed the petition, but against the possibility that the petition would be granted, he also requested that the court take action to allow him to participate in a new selection of the arbitrators. The Contra Costa County Superior Court granted the petition on March 13, 2006, and declined to intervene in the AAA's procedures for selecting an arbitrator. [End of quotation from Turner I.]
In Turner I, this court granted defendants' motion to dismiss the appeal, concluding that any decision we made in connection with Turner's request for an order and injunction restraining defendants from taking any action concerning the arbitration unless an order compelling arbitration was issued could have no practical effect on the parties, because such an order had been issued in the Contra Costa action. (Turner I, supra, A112884.) In Turner II, for the same reason, we dismissed as moot Turner's appeal of the judgment entered after the trial court sustained the demurrer of AAA, which was also a defendant in the action, on the ground that it enjoyed arbitral immunity. (Turner II, supra, A113905.)
Defendants thereafter moved in the trial court for judgment on the pleadings, and the trial court granted the motion and entered judgment in defendants' favor. The court also ruled that defendants were entitled to their costs and attorney fees in an amount to be determined. Defendants moved for an *979 award of the attorney fees they incurred in their successful defense of the San Francisco action, including their expenses on appeal, and the trial court granted the motion, awarding them $82,280.78 in fees.[2]

II. DISCUSSION
The agreement contains two provisions pertinent to the issues Turner raises on appeal. Paragraph 13 provides: "Attorney's Fees. In the event any legal action or arbitration is commenced of any kind or character, to enforce the provisions of this Agreement or to obtain damages for breach thereof, the prevailing party in such action shall be entitled to all costs and reasonable attorney's fees incurred in connection with such action." Paragraph 19 provides: "Arbitration. Except as provided in Paragraph 8 [relating to death of a spouse or dissolution of marriage], in the event any controversy or claims arising out of this Agreement cannot be settled by the parties hereto or their legal representatives, ... such controversy or claims shall be settled by arbitration in accordance with the then current rules of the American Arbitration Association and judgment upon the award may be entered in any Court having jurisdiction thereof. In addition to any other sums found to be due, if any, the prevailing party in any such proceeding shall be entitled to recover from the other party, the costs of said proceeding including reasonable attorney's fees." The trial court awarded fees under Paragraph 13, explaining its reasoning at the hearing on the motion as follows: "I think that the defendant here clearly is a prevailing party; that this action is separate and independent of the arbitration action; that the fees requested are reasonable and certainly no evidence has been presented to suggest otherwise."
Turner contends that the trial court erred in so ruling. According to Turner, the San Francisco action was not "on the contract" for purposes of Civil Code section 1717 (section 1717),[3] and the party who prevails under the agreement will not be known until after the final resolution of the underlying dispute that is, until after the arbitration is complete. He also contends that under Paragraph 19, only the arbitrator is entitled to award attorney fees.
(1) We first reject Turner's contention that the action was not "on the contract." California courts construe the term "on a contract" liberally. "`As *980 long as the action "involve[s]" a contract it is "`on [the] contract'" within the meaning of section 1717. [Citations.]' [Citations.]" (Blickman Turkus, LP v. MF Downtown Sunnyvale, LLC (2008) 162 Cal.App.4th 858, 894 [76 Cal.Rptr.3d 325].) Where an attorney fee clause provides for an award of fees incurred in enforcing the contract, the prevailing party is entitled to fees for any action "on the contract," whether incurred offensively or defensively. (Shadoan v. World Savings & Loan Assn. (1990) 219 Cal.App.3d 97, 107 [268 Cal.Rptr. 207] (Shadoan); see also IMO Development Corp. v. Dow Corning Corp. (1982) 135 Cal.App.3d 451, 464 [185 Cal.Rptr. 341].) Such fees are properly awarded under section 1717 "to the extent that the action in fact is an action to enforceor avoid enforcement ofthe specific contract." (Shadoan, supra, 219 Cal.App.3d at p. 108.) An action for declaratory relief can be an action "on a contract." (See City and County of San Francisco v. Union Pacific R.R. Co. (1996) 50 Cal.App.4th 987, 999-1000 [58 Cal.Rptr.2d 1]; Milman v. Shukhat (1994) 22 Cal.App.4th 538, 545 [27 Cal.Rptr.2d 526].) In this action, Turner sought declaratory and injunctive relief to avoid enforcement of the agreement's arbitration provision absent an order compelling arbitration. Under these circumstances, we conclude that this action was on the contract for purposes of an award of attorney fees.
Turner contends, however, that the trial court should not have awarded attorney fees because there is not yet a prevailing party in the underlying dispute, and that under the agreement attorney fees, if any, should be awarded by the arbitrator after the matter has been resolved on the merits. As we have noted, the agreement contains two distinct attorney fee clauses: Paragraph 19 provides that disputes arising out of the agreement should be settled by arbitration and entitles the party prevailing in the arbitration to recover attorney fees; Paragraph 13 establishes an entitlement to attorney fees for the prevailing party "[i]n the event any legal action or arbitration is commenced of any kind or character, to enforce the provisions of this Agreement or to obtain damages for breach thereof." (Italics added.) Thus, the agreement specifically provides for attorney fees to be awarded in the event a legal action, such as this, is brought to enforce it.
The parties have cited no cases presenting the precise procedural posture at issue herethat is, an award of contractual attorney fees in a separate action to stay an arbitrationand our own research has disclosed none. We find analogies, however, in cases considering whether attorney fees are available after a court has ruled on a petition to compel arbitration but before the merits of the underlying dispute have been decided. As our discussion will show, the Courts of Appeal have reached different results in those cases.
In one of those cases, Acosta v. Kerrigan (2007) 150 Cal.App.4th 1124 [58 Cal.Rptr.3d 865] (Acosta), the court considered contentions nearly identical to *981 those Turner raises here. In Acosta, an "Occupancy Agreement" between the plaintiff and one defendant, Kerrigan, provided that the exclusive remedy for any disputes regarding any aspect of the agreement was arbitration. The arbitration clause included the following language: "`Should any party to this Agreement hereafter institute any legal action or administrative proceeding against the other by any method other than said arbitration, the responding party shall be entitled to recover from the initiating party all damages, costs, expenses, and attorneys' fees incurred as a result of such action.'" (Id. at p. 1126.) The plaintiff filed a complaint for writ of possession, and the defendants successfully petitioned to compel arbitration. (Ibid.) The trial court granted Kerrigan's motion for attorney fees incurred in connection with the successful petition. (Id. at p. 1127.) On appeal, the plaintiff raised two contentions: that Kerrigan's claim for attorney fees should be decided by the arbitrator rather than the trial court, and that an interim award of attorney feesthat is, one made before the arbitration takes placeis impermissible. (Id. at pp. 1128-1129.)
(2) In its majority opinion, the Court of Appeal first concluded it was proper for the trial courtnot the arbitratorto award fees arising from the petition to compel arbitration. Although acknowledging that it was a close question, the court stated: "Given the trial court is responsible for deciding a petition to compel arbitration, the trial court also should be responsible for resolving a claim for attorney fees made in connection with that petition to compel arbitration." (Acosta, supra, 150 Cal.App.4th at p. 1130.) The court reasoned that the contract itself contemplated litigation outside the context of arbitration might take place, that a determination of whether attorney fees should be awarded and the amount of the award was "part and parcel of the proceeding on the petition," and that "the `"`experienced trial judge is the best judge of the value of professional services rendered in his court.'"'" (Id. at p. 1130.) In this case, we likewise conclude thatto the extent the fees for this legal proceeding are permissible under Paragraph 13 and section 1717they could appropriately be awarded by the trial court rather than the arbitrator.
(3) The Court of Appeal in Acosta went on to conclude that attorney fees incurred in connection with the petition to compel arbitration could properly be awarded before the arbitration took place, although at what might be "an interim stage of the overall proceedings in this case." (Acosta, supra, 150 Cal.App.4th at p. 1131, capitalization & boldface omitted.) The court noted that the right to attorney fees for the legal action arose from an independent contractual provision allowing fees in such proceedings, and concluded there was no reason Kerrigan should have to wait until the arbitration was concluded to receive fees to which he was contractually entitled. (Id. at p. 1132.) Similarly here, the agreement contained a provision contemplating *982 the possibility of a legal action to enforce the agreement, and authorizing an award of attorney fees "incurred in connection with such action." (Italics added.)
Otay River Constructors v. San Diego Expressway (2008) 158 Cal.App.4th 796 [70 Cal.Rptr.3d 434] (Otay) also considered the availability of attorney fees after a petition to compel arbitration. The parties there had entered into two design-build contracts, one of which allowed litigation in the event of disputes and one of which required arbitration, and a "Coordination Agreement" that required binding arbitration. (Id. at p. 800.) Otay filed a petition to compel arbitration under the coordination agreement, and Expressway successfully opposed the petition, contending the disputes arose under the design-build contract that did not provide for arbitration. (Id. at pp. 800-801.) The trial court denied Expressway's motion for attorney fees, concluding it was not a prevailing party because the parties contemplated further litigation. (Id. at p. 801.)
(4) The Court of Appeal reversed the order denying attorney fees, ruling that "Expressway was the prevailing party as a matter of law because it defeated the only contract claim before the trial court in this discrete special proceeding." (Otay, supra, 158 Cal.App.4th at pp. 807, 809.) In doing so, it rejected Otay's contention that Expressway was not a prevailing party because it had "obtained only an interim procedural victory." (Id. at p. 807.) It noted that in other cases, courts had awarded attorney fees to a party "obtaining an appealable order or judgment in a discrete legal proceeding even though the underlying litigation on the merits was not final." (Ibid.) For example, in Christensen v. Dewor Developments (1983) 33 Cal.3d 778, 780-781, 784, 786-787 [191 Cal.Rptr. 8, 661 P.2d 1088], our Supreme Court concluded the trial court had abused its discretion in denying a motion for attorney fees made by a party who had successfully opposed a petition to compel arbitration, although the underlying litigation on the merits was not final and further litigation was contemplated. The court in Otay also relied on Cole v. BT & G, Inc. (1983) 141 Cal.App.3d 995 [190 Cal.Rptr. 690]. There, the Court of Appeal concluded that the defendants who had successfully moved to vacate a confession of judgment were entitled to contractual attorney fees as prevailing parties. (Id. at pp. 996-997.) The court rejected the plaintiffs' contention that the defendants were not entitled to attorney fees until a trial had determined the merits of the dispute between the parties, stating: "The fallacy in plaintiffs' [position] is that here there are two actions: one on the confession of judgment and another on the agreement and note. A final, appealable judgment was entered on the validity of the confession of judgment, and a new and independent lawsuit was required in order to pursue defendants' liability for the obligation under the agreement. This is not the *983 situation . . . where an appeal was attempted from an interlocutory order or decree rendered during litigation." (Id. at p. 998.)[4]
Other cases, however, have concluded that fees incurred in connection with a petition to compel arbitration are not available until the merits of the underlying dispute have been determined. For instance, the Court of Appeal in Lachkar v. Lachkar (1986) 182 Cal.App.3d 641, 647-649 [227 Cal.Rptr. 501] (Lachkar), cited by Turner, ruled that there was no prevailing party under section 1717 after a successful petition to compel arbitration because there had not yet been a final disposition of the substantive rights of the parties. Similarly, Division Five of the First District Court of Appeal concluded in Green v. Mt. Diablo Hospital Dist. (1989) 207 Cal.App.3d 63, 76-77 [254 Cal.Rptr. 689], that the trial court had acted properly in denying attorney fees to the party that had successfully opposed a motion to compel arbitration because the trial court had not yet reached the merits of the case.
(5) We conclude that the reasoning of Acosta and Otay is more persuasive in the particular procedural context of this case. The fees at issue were incurred in connection with an independent complaint for declaratory and injunctive relief. As in Otay, the only issue before the courtwhether the arbitration should be allowed to proceedwas resolved in defendants' favor in this discrete legal proceeding. (See Otay, supra, 158 Cal.App.4th at p. 807.) Moreover, as in Acosta, the agreement between the parties contemplates the possibility that an action on the contract may be brought in court, and the agreement provides for an award of attorney fees incurred in connection with "such action." (Italics added.) (See Acosta, supra, 150 Cal.App.4th at pp. 1126, 1129, 1130.) Under the circumstances, it appears that defendants' entitlement to attorney fees in this legal action is independent of the outcome of the arbitration of the merits of the underlying dispute, and like the court in Acosta, we see no reason that an award of fees may not be made now. (See id. at pp. 1131-1133.) Irrespective of who becomes the prevailing party in the subsequent arbitration, there was a prevailing party for *984 purposes of section 1717 in this discrete proceeding on the contract, and the trial court could properly award attorney fees.[5]
None of the other cases Turner cites persuades us otherwise, as they each involve an interim ruling, where further proceedings in the same litigation were contemplated, rather than discrete legal proceedings. Thus, the Court of Appeal in Bank of Idaho v. Pine Avenue Associates (1982) 137 Cal.App.3d 5, 7, 11-16 [186 Cal.Rptr. 695], ruled that a party which had obtained reversal of a judgment dismissing an action after a demurrer was sustained without leave to amend was not a prevailing party within the meaning of an earlier version of section 1717, because there had not yet been a final disposition of the litigation. In 580 Folsom Associates v. Prometheus Development Co. (1990) 223 Cal.App.3d 1, 28-30 [272 Cal.Rptr. 227], the court ruled that a party which had successfully opposed a petition for writ of mandate seeking to set aside an order granting summary adjudication was not a prevailing party under section 1717. The Court of Appeal noted that it had denied the writ petition without a written opinion, and that the denial was therefore neither res judicata nor law of the case and was subject to later appellate review. It concluded that the party opposing the petition was therefore not a prevailing party. (580 Folsom, at p. 30.) Further proceedings were similarly contemplated in the other cases cited by Turner. (See Liu v. Moore (1999) 69 Cal.App.4th 745, 754-755 [81 Cal.Rptr.2d 807] [right to attorney fees on appeal deferred until final resolution of case on remand]; Lindenstadt v. Staff Builders, Inc. (1997) 55 Cal.App.4th 882, 894 & fn. 9 [64 Cal.Rptr.2d 484] [determination of prevailing party must await outcome of further proceedings on remand]; Presley of Southern California v. Whelan (1983) 146 Cal.App.3d 959, 960-961 [196 Cal.Rptr. 1] [party successful in obtaining reversal of summary judgment on appeal not entitled to attorney fees on appeal because action was ongoing; reversal of summary judgment was "merely an interim stage of the litigation"].)
In sum, like the court in Acosta, we find this to be a close question. We are satisfied, however, that this result is correct because, as in Acosta, even if Turner prevails on some or all of his claims in the course of the arbitration, and that award is confirmed in the Contra Costa action, it would not be in derogation of defendants' independent right to attorney fees in this, the San *985 Francisco action, under Paragraph 13.[6] It was Turner who initiated both actions; he must accept the consequences of forcing defendants to fight on two fronts.

III. DISPOSITION
The judgment is affirmed.
Ruvolo, P.J., and Reardon, J., concurred.
NOTES
[1]  Bracketed material indicates additions to the language of Turner I. Empty brackets indicate deletions. We take judicial notice of our opinions in Turner I and Turner II, and of the records in those cases.
[2]  Turner filed separate appeals from both the order awarding attorney fees (No. A121642) and the amended judgment which reflects the award (No. A121707). Turner filed separate briefs in the two appeals, raising identical issues. On our own motion, we have consolidated the two appeals. AAA was not a party to the motion for attorney fees at issue here.
[3]  Section 1717, subdivision (a), provides in pertinent part: "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 either to one of the parties or to the prevailing party, 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 in addition to other costs."
[4]  The court in Otay also noted Estate of Drummond (2007) 149 Cal.App.4th 46 [56 Cal.Rptr.3d 691], describing it as follows: "[A]ttorney fees improperly granted where dismissal of probate petition determined nothing on the contract and simply moved action to another forum." (Otay, supra, 158 Cal.App.4th at p. 807.) The court in Drummond ruled that the trial court had not abused its discretion in finding that neither party had prevailed on the contract where the party seeking attorney fees had obtained only an interim victory, by establishing that a petition brought in the probate department of a court should instead be brought as a cross-claim in a separate civil action in the same court. (Drummond, supra, 149 Cal.App.4th at pp. 49, 51-54.) In doing so, the court declined to follow Cole and likened the disposition of the probate petition to "the sustaining of a plea in abatement on grounds that an action on the same subject matter was already pending in another forum." (Drummond, at p. 52.) Here, in contrast, Turner's claim for declaratory and injunctive relief was not moved to another forum, it was denied outright.
[5]  We also note that Lachkar was decided under an earlier version of section 1717, under which the "prevailing party" was defined as, with certain exceptions, "the party who is entitled to recover costs of suit." (Stats. 1983, ch. 1073, § 1, pp. 3785-3786; see Lachkar, supra, 182 Cal.App.3d at p. 648.) Section 1717, subdivision (b)(1) now defines "the party prevailing on the contract" as "the party who recovered a greater relief in the action on the contract." (Italics added.) This language suggests that where, as here, there is a discrete action "on the contract," attorney fees are available to the party who achieved greater relief in that action.
[6]  At oral argument, Turner's counsel asserted that a fee award is improper at this stage because the arbitrator might find the agreementincluding the attorney fees clausesvoid and unenforceable, thus negating his contractual obligation to pay the attorney fees. This is highly unlikely. Turner has never claimed that the contract is voidable based upon fraud in the inducement, which is an issue that can and should be decided by the arbitrator. (Brown v. Wells Fargo Bank, N.A. (2008) 168 Cal.App.4th 938, 958 [85 Cal.Rptr.3d 817] (Brown).) Rather, in the Contra Costa action, Turner alleged that the contract was void ab initio due to fraud in the inception, which is an issue that can and must be decided by the court. (Rosenthal v. Great Western Fin. Securities Corp. (1996) 14 Cal.4th 394, 416-417 [58 Cal.Rptr.2d 875, 926 P.2d 1061]; Brown, supra, 168 Cal.App.4th at p. 958.) In the alternative, Turner seeks damages and not rescission as a remedy for the alleged fraudulent representations. In any event, nothing in this opinion precludes the attorney fees awarded by the trial court, and paid by Turner, from being included in any future measure of damages, if there is a legal basis for doing so.
