
33 Cal.Rptr.3d 817 (2005)
132 Cal.App.4th 614
WAL-MART REAL ESTATE BUSINESS TRUST, Plaintiff and Respondent,
v.
CITY COUNCIL OF the CITY OF SAN MARCOS, Defendant and Respondent;
Lori A. Drake et al., Real Parties in Interest and Appellants,
Brookfield University Commons, LLC, Real Party in Interest and Respondent.
No. D044941.
Court of Appeal, Fourth District, Division One.
September 7, 2005.
*819 Van Blarcom, Leibold, McClendon & Mann, John G. McClendon, Laguna Hills, and Stephen M. Miles for Real Parties in Interest and Appellants.
*820 Gresham Savage Nolan & Tilden and John C. Nolan, San Bernardino, for Plaintiff and Respondent Wal-Mart Real Estate Business Trust.
Lounsbery Ferguson Altona & Peak, LLP, Helen Holmes Peak, San Diego, and Judith Hartwig, Escondido, for Defendant and Respondent City Council of the City of San Marcos.
Sheppard Mullin Richter & Hampton LLP, Edward D. Vogel, John E. Ponder and Karin Dougan Vogel, San Diego, for Real Party in Interest and Respondent Brookfield University Commons, LLC.
*818 McCONNELL, P.J.
Ordinarily, constitutional and other challenges to referendum petitions are reviewed after an election so the electoral process is not disrupted. Here, plaintiff Wal-Mart Real Estate Business Trust (Wal-Mart) petitioned for a writ of mandate seeking to preclude or delay a referendum vote challenging the decision of defendant City Council of the City of San Marcos (the City)[1] to allow Wal-Mart to build a second store in the City, on the grounds the referendum petition violated certain Elections Code provisions. Real parties in interest Lori A. Drake and Randall R. Walton successfully opposed Wal-Mart's petition for writ of mandate, and the issue on appeal is whether they are entitled to attorney fees from Wal-Mart under a private attorney general theory. (Code of Civ. Proc.,[2] § 1021.5.)
We conclude the trial court's denial of attorney fees against Wal-Mart constitutes abuse of discretion. We reject Wal-Mart's contention that Drake and Walton are not successful parties within the meaning of section 1021.5 since after voters disapproved of the City's action Wal-Mart dropped the matter and the court was never required to consider the merits of its challenge to the adequacy of the referendum petition. Drake and Walton achieved their objective by thwarting Wal-Mart's attempt to preclude or delay the referendum vote and the court's denial of its petition for writ of mandate was the last word on the matter. Further, Drake and Walton's opposition to Wal-Mart's petition resulted in the enforcement of an important right affecting the public interest and conferred a significant benefit on the City's voters.
We also conclude the denial of attorney fees against the City and real party in interest Brookfield University Commons, LLC (Brookfield), was within the court's discretion.

FACTUAL AND PROCEDURAL BACKGROUND
In August 2003 the City approved general and specific plan amendments that changed the land use for a 20-acre parcel from residential to commercial, to permit the development of a second Wal-Mart store in the City. Wal-Mart had entered into an agreement to purchase the property from Brookfield, and Brookfield requested the land use change from the City.
The following month, Drake and Walton, residents of the City, submitted to Susie Vasquez, the City's Clerk, a referendum petition with 4,723 signatures challenging the City's action and seeking to put the matter to a vote.[3] Vasquez delivered *821 the petition to the San Diego County Registrar of Voters for signature verification.
In October 2003 Wal-Mart filed a petition for peremptory writ of mandate (§ 1085) against the City, Vasquez and Sally McPherson, the San Diego County Registrar of Voters.[4] Wal-Mart named Drake, Walton and Brookfield as real parties in interest. Wal-Mart also filed a motion for an order directing the issuance of a peremptory writ of mandate, which Brookfield joined. Wal-Mart sought invalidation of the referendum petition on grounds it violated the Elections Code by not including the full text of the City's various documents implementing the land use change (Elec.Code, § 9238, subd. (b)), and because, as noted in a report by Vasquez, 3,594 signatures were obtained by persons not registered to vote or qualified to register to vote in the City (Elec.Code, § 9238, subd. (c)). Wal-Mart also argued that in approving the land use change the City was acting as a redevelopment agency, and "[a]ctions taken by a local [r]edevelopment [a]gency are `administrative' in character and thus not subject to referendum."
The City did not oppose the petition or motion. Rather, the City and Vasquez filed a document titled a "response," in which they sought the court's guidance on the proper verification of petition signatures. The City submitted evidence the San Diego County Registrar of Voters does not follow Elections Code section 9238, subdivision (c), "but rather follows the procedures for verification of petitions provided on June 27, 1997 by John Mott-Smith, Chief of the Elections Division of the Office of the Secretary of State." Mott-Smith's information stated that signatures are to be counted if "otherwise valid" when the circulator is "not registered in the city in which the petition was circulated." Circulators not in compliance with section 9238, subdivision (c) are to be referred to the city clerk's office. The City and Vasquez's response stated, "[b]ecause of the conflicting criteria for determining the validity of signatures collected by circulators who are neither registered nor eligible to register to vote in the City . . ., the City seeks the [c]ourt's determination of the procedure to be followed."
Drake and Walton opposed Wal-Mart's petition and motion. They argued, among other things, that according to case law a pre-ballot challenge to a referendum is a disruption of the electoral process the court should not permit absent a compelling showing the substantive provisions of the referendum are invalid, a criterion not met.
The court issued a tentative ruling denying Wal-Mart's motion "on the grounds as stated in [Drake and Walton's] opposition and supplemental opposition thereto; specifically, that `"it is usually more appropriate to review constitutional and other challenges to ballot propositions or initiative measures after an election rather than to disrupt the electoral process by preventing the exercise of the people's franchise, in the absence of some clear showing of invalidity."'" (Citing deBottari v. City Council of the City of Norco (1985) 171 Cal.App.3d 1204, 1209, 217 Cal.Rptr. 790 (deBottari); Brosnahan v. Eu (1982) 31 Cal.3d 1, 4, 181 Cal.Rptr. 100, 641 P.2d 200.) Further, the court declined to issue an advisory opinion as the City requested. After a hearing, the court confirmed its tentative ruling. It entered judgment denying Wal-Mart's motion *822 and dismissing its petition without prejudice.
On March 2, 2004, the referendum, designated as Proposition G, went before the City's voters. The City's action was defeated, with approximately 61 percent of the electorate objecting to the proposed Wal-Mart store. Wal-Mart and Brookfield brought no post-ballot challenge to the referendum.
Drake and Walton moved for attorney fees from Wal-Mart, Brookfield and the City under section 1021.5, arguing their opposition to Wal-Mart's petition "resulted in the enforcement of important rights affecting the public interest and conferred a significant benefit on the general public or a large class of persons." They sought $106,165 in fees based on a "lodestar" multiplier method. The matter was heard by another judge, who denied the motion on the ground the judge who denied Wal-Mart's petition for lack of ripeness "did not make any substantive rulings on this case," and "it would be a stretch to then . . . conclude that something that was not adjudicated . . . leads to a significant benefit."

DISCUSSION

I
"An important exception to the American rule that litigants are to bear their own attorney fees is found in section 1021.5" (Graham v. DaimlerChrysler Corp. (2004) 34 Cal.4th 553, 565, 21 Cal.Rptr.3d 331, 101 P.3d 140 (Graham)), which codifies the "private attorney general doctrine" the California Supreme Court adopted in Serrano v. Priest (1977) 20 Cal.3d 25, 47, 141 Cal.Rptr. 315, 569 P.2d 1303. (Hull v. Rossi (1993) 13 Cal.App.4th 1763, 1766-1767, 17 Cal.Rptr.2d 457.) Section 1021.5 provides in part: "Upon motion, a court may award attorneys' fees to a successful party against one or more opposing parties in any action which has resulted in the enforcement of an important right affecting the public interest if: (a) a significant benefit, whether pecuniary or nonpecuniary, has been conferred on the general public or a large class of persons, (b) the necessity and financial burden of private enforcement . . . are such as to make the award appropriate, and (c) such fees should not in the interest of justice be paid out of the recovery, if any."
"`[T]he private attorney general doctrine "rests upon the recognition that privately initiated lawsuits are often essential to the effectuation of the fundamental public policies embodied in constitutional or statutory provisions, and that, without some mechanism authorizing the award of attorney fees, private actions to enforce such important public policies will as a practical matter frequently be infeasible." Thus, the fundamental objective of the doctrine is to encourage suits enforcing important public policies by providing substantial attorney fees to successful litigants in such cases.'" (Graham, supra, 34 Cal.4th at p. 565, 21 Cal.Rptr.3d 331, 101 P.3d 140.)
Whether the applicant for attorney fees has proved section 1021.5's elements is a matter primarily vested in the trial court. (Ciani v. San Diego Trust & Savings Bank (1994) 25 Cal.App.4th 563, 571, 30 Cal.Rptr.2d 581.) "We review the entire record, attentive to the trial court's stated reasons in denying the fees and to whether it applied the proper standards of law in reaching its decision. [Citation.] We will reverse the trial court's decision only if there has been a prejudicial abuse of discretion, i.e., when there has been a manifest miscarriage of justice or `"where no reasonable basis for the action is shown."'" (Hull v. Rossi, supra, 13 Cal.App.4th at p. 1767, 17 Cal.Rptr.2d 457.)


*823 II

A

1
Drake and Walton contend the trial court abused its discretion by denying their request for attorney fees under section 1021.5. We agree insofar as Wal-Mart is concerned.
Wal-Mart asserts Drake and Walton were not "successful parties" within the meaning of section 1021.5 because in denying Wal-Mart's petition for writ relief "all . . . they achieved . . . was the [t]rial [c]ourt's acknowledgment . . . that Wal-Mart's suit had come too early, and needed to await the results of the referendum election." (Emphasis omitted.) Wal-Mart points out that Drake and Walton obtained no ruling on the "underlying issue," "whether there were irregularities in obtaining signatures to compel the referendum election." (Emphasis omitted.)
Drake and Walton submit Wal-Mart waived the issue by not raising it at the trial court. (See Royster v. Montanez (1982) 134 Cal.App.3d 362, 367, 184 Cal.Rptr. 560.) Even without waiver, however, Wal-Mart's position is unpersuasive.
"The term `successful party,' as ordinarily understood, means the party to litigation that achieves its objectives." (Graham, supra, 34 Cal.4th at p. 571, 21 Cal.Rptr.3d 331, 101 P.3d 140.) "`A lawsuit's ultimate purpose is to achieve actual relief from an opponent. . . . On this common understanding, if a party reaches the "sought-after destination," then the party "prevails" regardless of the "route taken." [Citation.]'" (Ibid.) In bringing its petition, Wal-Mart sought to keep the referendum off the ballot. In opposing the petition, on ripeness and other grounds, Drake and Walton sought dismissal of the petition to allow a vote on the City's action to proceed, and that is precisely the relief they obtained.
The court relied on deBottari, supra, 171 Cal.App.3d 1204, 217 Cal.Rptr. 790, which Drake and Walton cited in their opposition. The deBottari court explained "`it is usually more appropriate to review constitutional and other challenges to ballot propositions or initiative measures after an election rather than to disrupt the electoral process by preventing the exercise of the people's franchise, in the absence of some clear showing of invalidity.'" (Id. at p. 1209, 217 Cal.Rptr. 790, italics added, citing Brosnahan v. Eu, supra, 31 Cal.3d 1, 4, 181 Cal.Rptr. 100, 641 P.2d 200.) "It may be . . . that it will become unnecessary to decide the question of validity if the initiative measure is defeated at the polls." (Gayle v. Hamm (1972) 25 Cal.App.3d 250, 257, 101 Cal.Rptr. 628.) In accordance with Drake and Walton's argument, the court found there was no clear showing of any invalidity. The court's judgment expressly states its ruling was based on Drake and Walton's opposition, and indeed, they were the only parties involved in this appeal who opposed the petition.
Moreover, Drake and Walton addressed the substantive merits of the arguments Wal-Mart raised in its petition. Wal-Mart could have raised the issues again by contesting the referendum vote within 30 days "after the declaration of the result of the election by the body canvassing the returns thereof" (Elec.Code, § 16401, subd. (d)), but it did not do so. Accordingly, the judgment dismissing Wal-Mart's petition without prejudice constituted the final decision and the merits of the dispute were not reached. In determining whether a party was "successful" for purposes of Code of Civil Procedure section 1021.5, "[t]he critical fact is the impact of the action, not the manner of its *824 resolution." (Folsom v. Butte County Assn. of Governments (1982) 32 Cal.3d 668, 685, 186 Cal.Rptr. 589, 652 P.2d 437.) An award is not barred when the case was won on a preliminary matter, the case settled or the opposing party voluntarily withdrew its claim. (See ibid.) "`A court should still award fees even though it might conclude, as a matter of equity, that no formal relief ... is needed.'" (Id. at pp. 685-686, 186 Cal.Rptr. 589, 652 P.2d 437.)
Wal-Mart asserts that only a plaintiff or petitioner is eligible for attorney fees under section 1021.5. The statute, however, says no such thing. Rather, it provides "a court may award attorneys' fees to a successful party against one or more opposing parties." (§ 1021.5.) "[S]ection 1021.5 draws no distinctions between plaintiffs and defendants as a `successful party.'" (Hull v. Rossi, supra, 13 Cal.App.4th at p. 1768, 17 Cal.Rptr.2d 457; County of San Luis Obispo v. Abalone Alliance (1986) 178 Cal.App.3d 848, 869, 223 Cal.Rptr. 846; City of Sacramento v. Drew (1989) 207 Cal.App.3d 1287, 1302, 255 Cal.Rptr. 704.) In Hull v. Rossi, at page 1765, 17 Cal.Rptr.2d 457, the court held real parties in interest were entitled to attorney fees under section 1021.5. The court also noted a "`prospective private attorney general should not have to rely on the prospect that the court will do the right thing without opposition.'" (Hull v. Rossi, at p. 1768, 17 Cal.Rptr.2d 457.) In opposing Wal-Mart's petition, Drake and Walton "achieved a victory that was substantial and which qualifies [them] as prevailing parties under section 1021.5." (Ibid.)

2
We also conclude Drake and Walton's opposition to Wal-Mart's petition "resulted in the enforcement of an important right affecting the public interest," and conferred "a significant benefit" on a large class of persons within the meaning of section 1021.5. As this court has explained, the "state constitutional right of initiative or referendum is `one of the most precious rights of our democratic process.' [Citation.] These powers are reserved to the people, not granted to them. Thus, it is our duty to `"`jealously guard'"' these powers and construe the relevant constitutional provisions liberally in favor of the people's right to exercise the powers of initiative and referendum." (Pala Band of Mission Indians v. Board of Supervisors (1997) 54 Cal.App.4th 565, 574, 63 Cal.Rptr.2d 148.)
In Hull v. Rossi, supra, 13 Cal.App.4th at page 1763, 17 Cal.Rptr.2d 457, the appellate court held the trial court abused its discretion by denying attorney fees to real parties in interest who opposed a petition for writ of mandate seeking deletion of their ballot arguments in the official voters' pamphlet. The trial court ordered minor wording changes, but largely rejected the petitioners' claims. The appellate court found the "public's right to an accurate impartial analysis under [the] Elections Code . . . constitutes an important right within the meaning of section 1021.5." (Id. at p. 1768, 17 Cal.Rptr.2d 457.) The electorate's constitutional right to a referendum vote is also an important right under section 1021.5, and Drake and Walton's opposition to Wal-Mart's petition to thwart the vote, or at least delay it, protected the rights of thousands of registered voters to proceed in accordance with state law.
Wal-Mart contends the court's ruling was proper because private enforcement was not a "necessity" within the meaning of section 1021.5, subdivision (b). "This factor `"looks to the adequacy of public enforcement and seeks economic *825 equalization of representation in cases where private enforcement is necessary."'" (Committee to Defend Reproductive Rights v. A Free Pregnancy Center (1991) 229 Cal.App.3d 633, 639, 280 Cal.Rptr. 329.) An important question in determining whether the services of the private party were necessary is, "Did the private party advance significant factual or legal theories adopted by the court, thereby providing a material non de minimis contribution to its judgment, which were nonduplicative of those advanced by the governmental entity?" (Id. at pp. 642-643, 280 Cal.Rptr. 329.)
Neither the City nor Vasquez filed any written opposition to the petition. Rather, together they filed a document titled a "response," in which they sought an advisory opinion on how signatures on the referendum should be counted. They did not argue the petition was premature, and they did not cite the opinion in deBottari, supra, 171 Cal.App.3d 1204, 217 Cal.Rptr. 790. In ruling against Wal-Mart, the court specifically relied on Drake and Walton's argument and the deBottari opinion.
Wal-Mart asserts private enforcement was unnecessary because "at the hearing, the public officials were ably represented by three separate attorneys, and . . . argument was presented that supported the [c]ourt's ruling that Wal-Mart's action was premature, and should wait until after the referendum election." (Emphasis omitted.) The assertion is disingenuous, as neither of the City's two attorneys addressed the ripeness issue nor argued the referendum vote should proceed. In response to a question from the court, one of the attorneys explained the zoning change to allow another Wal-Mart store was made by the City and not by an independent redevelopment agency, contrary to Wal-Mart's argument. That was the extent of counsels' input. Vazquez had separate counsel at the hearing, and he addressed the ripeness issue. By that time, however, the court had issued its tentative ruling based on Drake and Walton's opposition. In any event, Drake and Walton did not seek attorney fees from Vasquez. Under the circumstances, we reject Wal-Mart's assertion "[p]ublic enforcement was being effectively pursued." (Emphasis omitted.)
We conclude the trial court abused its discretion by denying Drake and Walton's motion for attorney fees from Wal-Mart. We remand the matter for a new hearing on the proper amount of an award.

B
Drake and Walton contend Wal-Mart, the City and Brookfield are jointly and severally liable for their attorney fees under section 1021.5. Drake and Walton rely on Nestande v. Watson (2003) 111 Cal.App.4th 232, 4 Cal.Rptr.3d 18, in which this court explained "we construe the term `opposing party' as used in section 1021.5 to mean a party whose position in the litigation was adverse to that of the prevailing party. . . . [A]n `opposing party' within the meaning of section 1021.5 is a losing party." (Id. at pp. 240-241, 4 Cal.Rptr.3d 18.) A "governmental entity is not liable for attorney fees unless it has lost on the merits." (Id. at p. 241, 4 Cal.Rptr.3d 18.) In Nestande v. Watson, we held the defendant county was not an "opposing party" to the plaintiff because it "never took any legal position in the litigation that was adverse to [the real party in interest] and did not oppose [the real party in interest] on the merits of any legal issue." (Ibid.)
Drake and Walton assert "the best indication that the City was an opposing party is that the City itself did not oppose the writ of mandate sought by Wal-Mart." (Original italics.) However, to avoid the imposition of attorney fees the *826 City was not required to oppose the petition or adopt Drake and Walton's arguments. "`The private attorney general theory is based in part on the supposition that even in cases in which public enforcement is possible, public agencies are often unwilling or incapable because of insufficient staffing to protect important rights.'" (Nestande v. Watson, supra, 111 Cal.App.4th at p. 240, 4 Cal.Rptr.3d 18.) Section 1021.5 "does not authorize a successful [party] to recover attorney fees out of the public treasury simply because he or she has acted in the capacity of a private attorney general to enforce an important right affecting the public interest." (Ibid.)
Wal-Mart named the City a respondent in its petition for writ relief. The City filed its response the same day Drake and Walton filed their opposition, and the City did not argue against their positions. The City merely sought a judicial "determination of the procedure to be followed" in counting signatures on the referendum petition. Further, after Drake and Walton filed a supplemental opposition raising the lack of ripeness issue and further addressing the merits of Wal-Mart's petition, the City filed no reply. Additionally, at the hearing, the City's counsel took no position on Wal-Mart's petition. Counsel spoke only briefly, answering the court's question as to whether the City was acting as a redevelopment agency when it changed the land use for Brookfield's parcel from residential to commercial. Moreover, the court entered judgment in favor of the City.
"[W]e review the trial court's order, not its reasoning, and affirm an order if it is correct on any theory apparent from the record." (Blue Chip Enterprises, Inc. v. Brentwood Sav. & Loan Assn. (1977) 71 Cal.App.3d 706, 712, 139 Cal.Rptr. 651.) The denial of attorney fees from the City does not constitute abuse of discretion because it was not an "opposing party" within the meaning of section 1021.5.
Likewise, we do not fault the court for denying attorney fees from Brookfield on the ground "this party's role in the case would [not] justify fees, even if the criteria of [section] 1021.5 had otherwise been satisfied." The sole basis for Drake and Walton's request for fees from Brookfield is its written joinder in Wal-Mart's motion for an order directing issuance of a writ of mandate. Brookfield made no argument at the hearing, and the judgment, which Drake and Walton prepared, does not mention Brookfield other than noting it appeared at the hearing. The record shows the real dispute was between Drake and Walton and Wal-Mart.
"`Discretion is abused whenever, in its exercise, the court exceeds the bounds of reason, all of the circumstances before it being considered.'" (Denham v. Superior Court (1970) 2 Cal.3d 557, 566, 86 Cal.Rptr. 65, 468 P.2d 193.) The court's finding as to Brookfield does not qualify as an abuse of discretion.

DISPOSITION
The order is reversed insofar as it denies Drake and Walton's motion for attorney fees under section 1021.5 from Wal-Mart. The matter is remanded to the trial court for a new hearing on the amount of an award. The award shall include attorney fees incurred on appeal. In all other respects, the order is affirmed. Drake and Walton are awarded costs of appeal from Wal-Mart. The City and Brookfield are awarded costs of appeal from Drake and Walton.
WE CONCUR: HALLER and McDONALD, JJ.
NOTES
[1]  The City Council of the City of San Marcos and the City of San Marcos are sometimes referred to together as the City.
[2]  Statutory references are to the Code of Civil Procedure except when otherwise specified.
[3]  "The referendum is the means by which the electorate is entitled, as a power reserved by it under our state Constitution, to approve or reject measures passed by a legislative body." (Empire Waste Management v. Town of Windsor (1998) 67 Cal.App.4th 714, 717, 79 Cal.Rptr.2d 262; Cal. Const., art. IV, § 1.)
[4]  Vasquez and McPherson are not parties to this appeal.
