I concur. The majority opinion addresses primarily the limitations on the power of local officials to disobey statutes that may be, but have not yet been judicially established to be, unconstitutional. I write separately to focus on the related but distinct question of what courts should do when confronted with such disobedience on the part of local officials. As the majority opinion suggests, a court should not invariably refuse to decide constitutional questions arising from local governments’ or local officials’ refusal to obey purportedly unconstitutional statutes. Indeed, California courts *1121under these circumstances have, on a number of occasions, decided the underlying constitutional questions. In the present case, the majority declines to decide the constitutional validity of Family Code section 300, prohibiting same-sex marriage, but instead concludes that a writ of mandate against San Francisco’s (the city’s) local officials is justified because they exceeded their ministerial authority. As elaborated below, I agree that under these somewhat unusual circumstances, local officials’ disobedience of the statute justifies this court’s issuance of a writ of mandate against those officials before the underlying constitutional question has been adjudicated.
At the outset, I review the requirements for obtaining a writ of mandate. To obtain writ relief a petitioner must show: “ ‘(1) A clear, present and usually ministerial duty on the part of the respondent . . . ; and (2) a clear, present and beneficial right in the petitioner to the performance of that duty ....’” (Santa Clara County Counsel Attys. Assn. v. Woodside (1994) 7 Cal.4th 525, 539-540 [28 Cal.Rptr.2d 617, 869 P.2d 1142].) Also required is “the lack of any plain, speedy and adequate remedy in the usual course of law . . . .” (Flora Crane Service, Inc. v. Ross (1964) 61 Cal.2d 199, 203 [37 Cal.Rptr. 425, 390 P.2d 193].) Although the writ of mandate generally must issue if the above requirements are clearly met (see May v. Board of Directors (1949) 34 Cal.2d 125, 133-134 [208 P.2d 661]), the writ of mandate is an equitable remedy that will not issue if it is contrary to “promoting the ends of justice.” (McDaniel v. City etc. of San Francisco (1968) 259 Cal.App.2d 356, 361 [66 Cal.Rptr. 384]; see also Bartholomae Oil Corp. v. Superior Court (1941) 18 Cal.2d 726, 730 [117 P.2d 674].)
The local officials in the present case have a clear ministerial duty to issue marriage licenses in conformance with state statute and have violated that duty. The Attorney General, and for that matter the petitioners in Lewis v. Alfaro, have a substantial right to ensure that marriage licenses conform to the statute. (See Bd. of Soc. Welfare v. County of L.A. (1945) 27 Cal.2d 98, 100-101 [162 P.2d 627].) But when a court is asked to grant a writ of mandate to enforce a statute over which hangs a substantial cloud of unconstitutionality, the above-stated principles dictate that a court at least has the discretion to refuse to issue the writ until the underlying constitutional question has been decided.
How should courts exercise that discretion? In California, generally speaking, courts faced with local governments’ or local officials’ refusal to obey assertedly unconstitutional statutes have decided the constitutional question before determining whether a writ or other requested relief should issue. (See, e.g., County of Riverside v. Superior Court (2003) 30 Cal.4th 278 [132 Cal.Rptr.2d 713, 66 P.3d 718] [county refused to obey as unconstitutional a state statute mandating binding arbitration for local agencies that reach *1122negotiating impasse with police and firefighters]; Star-Kist Foods, Inc. v. County of Los Angeles (1986) 42 Cal.3d 1 [227 Cal.Rptr. 391, 719 P.2d 987] [county refused to act in accordance with a state revenue statute it had judged, correctly, to violate the U.S. Const.]; Zee Toys, Inc. v. County of Los Angeles (1978) 85 Cal.App.3d 763, 777-781 [149 Cal.Rptr. 750] [same]; Paso Robles etc. Hospital Dist. v. Negley (1946) 29 Cal.2d 203 [173 P.2d 813] [local financial officer refused to issue bonds and defended a lawsuit in order to expeditiously settle the constitutional validity of the bond issue]; Denman v. Broderick (1896) 111 Cal. 96, 105 [43 P. 516] [local official refused to spend public funds required by a statute believed to be unconstitutional “special legislation”]; City of Oakland v. Digre (1988) 205 Cal.App.3d 99 [252 Cal.Rptr. 99] [local official refused to enforce a parcel tax believed to be unconstitutional and required the city to demonstrate its constitutionality in court]; Bayside Timber Co. v. Board of Supervisors (1971) 20 Cal.App.3d 1, 14-15 [97 Cal.Rptr. 431] [county board of supervisors refused to issue permission for timber operations, although such refusal was not authorized under rules promulgated pursuant to state statute].) Indeed, any time a city determines that a state law is contrary to its own constitutional prerogative of self-governance and therefore refuses to obey the law, it is making a constitutional determination. (See, e.g., Bishop v. City of San Jose (1969) 1 Cal.3d 56, 63-64 [81 Cal.Rptr. 465, 460 P.2d 137] [determining that state prevailing wage law for public works projects was not binding on cities].)
As the majority states, “the classic understanding of the separation of powers doctrine [is] that the legislative power is the power to enact statutes, the executive power is the power to execute or enforce statutes, and the judicial power is the power to interpret statutes and to determine their constitutionality.” (Maj. opn., ante, at p. 1068.) But “the separation of powers doctrine does not create an absolute or rigid division of functions.” (Ibid.) As the above cases suggest, local officials sometimes exercise their authority to preliminarily determine that a statute that directly affects the local government’s functioning is unconstitutional and, in some circumstances, refuse to obey that statute as a means of bringing the constitutional challenge. This preliminary determination is the exercise of an executive function. Local officials and agencies do not “arrogate to [the local executive] core functions of [the judicial] branch” in violation of the separation of powers (Carmel Valley Fire Protection Dist. v. State of California (2001) 25 Cal.4th 287, 297 [105 Cal.Rptr.2d 636, 20 P.3d 533]), but rather raise constitutional issues for the courts to ultimately decide.
In my view, there are at least three types of situations in which a local government’s disobedience of a statute would be reasonable. In these situations, courts asked to grant a writ of mandate to compel the local agency to obey the statute should therefore address the underlying constitutional issue rather than simply conclude the local governmental entity exceeded its *1123ministerial authority. First, there are some cases in which the statute in question violates a “clearly established . . . constitutional right” (Harlow v. Fitzgerald (1982) 457 U.S. 800, 818 [73 L.Ed.2d 396, 102 S.Ct. 2727]). An executive decision not to spend resources to comply with a clearly unconstitutional statute is a reasonable exercise of the local executive power and does not usurp a core judicial function. Indeed, refusing to enforce clearly unconstitutional statutes saves the resources of both the executive and the judiciary.
A second category of “disobedience” cases involves a local official or governmental entity disobeying a statute when there is a substantial question as to its constitutionality and the statute governs matters integral to a locality’s limited power of self-governance. In these cases, a local entity or official is directly affected by the statute and in a unique position to challenge it. As the above cases illustrate, local entities and officials have challenged statutes to determine the validity of a bond, or the payment of a government salary for a position unconstitutionally created, or an exemption to a local tax that assertedly violates the commerce clause, or a statute that intrudes on local matters of city or county employee compensation. It is noteworthy that in virtually all the above cases, the local agency’s or official’s refusal to obey an assertedly unconstitutional statute had the effect of preserving the status quo, pending judicial resolution of the matter, thereby minimizing interference with the judicial function.
Perhaps in some of these cases localities could have proceeded by obtaining declaratory relief as to a statute’s unconstitutionality, rather than by disobeying the statute. In other cases, an actual controversy necessary for declaratory relief may have been lacking. In any case, the fact that the local government agency did not proceed by means of declaratory relief provided no insurmountable obstacle to a court’s deciding the underlying constitutional issue raised by the agency’s disobedience. (See, e.g., County of Riverside v. Superior Court, supra, 30 Cal.4th 278, 283.)1 Of course, if a court determines that interim relief to compel a government agency to obey a statute is appropriate, it may grant such relief before the constitutional question is ultimately adjudicated.
A third possible category of cases in which city officials might legitimately disobey statutes of doubtful constitutionality are those in which the question of a statute’s constitutionality is substantial, and irreparable harm may result to individuals to which the local government agency has some protective *1124obligation—be they employees, or students of a public college, or patrons of a public library, or patients in a public hospital, or in some cases simply residents of the city. Again, a court asked to grant a writ of mandate could conclude that a delay in granting the writ pending resolution of the underlying constitutional question is justified. To issue a writ enforcing a statute that may be unconstitutional, and that will work irreparable harm, would not “promot[e] the ends of justice” (McDaniel v. City etc. of San Francisco, supra, 259 Cal.App.2d at pp. 360-361), and a court has the discretion to delay such issuance until the underlying constitutional question is resolved.
The present case is quite different from the above situations. First, as the majority demonstrates, the unconstitutionality of Family Code section 300 is not clearly established by either state or federal constitutional precedent, and certainly not from the language of the constitutional provisions themselves. Nor does this case pertain to a statute that interferes with a city’s or county’s limited power of self-governance that these entities are in a unique position to challenge. Rather, local officials in this case perform a ministerial function pursuant to the state marriage law. Unlike the cases cited above, in which the constitutionality of a statute is likely to go unchallenged if a local governmental entity does not do so, Family Code section 300 limits individual rights, and those individuals subject to that limitation are in the best position to challenge it.
Nor does the present case fit the third category of cases, in which a city refuses to enforce a law so as to protect its citizens from irreparable harm. The only harm caused here is a delay in the ability of same-sex couples to get married while the constitutional issue is being adjudicated. But that delay will occur whether or not we grant a writ of mandate against the city in this case. Put another way, local officials have no real power to marry same-sex couples, given the statutory prohibition against doing so. What was within their power, prior to our issuance of a stay, was to issue licenses of indeterminate legal status. The exercise of the court’s mandate power to preclude local officials from continuing this course of action, and voiding the licenses already issued, brings no irreparable harm to the individuals who have received or might receive such licenses.
In sum, the city advances no plausible reason why it had to disobey the statute in question. Even so, it might have been appropriate to have delayed the issuance of a writ of mandate against it until the underlying constitutional question had been adjudicated if, for example, the city had issued a single “test case” same-sex marriage license. But it went far beyond a test case. It issued thousands of these marriage licenses. As such, the city went well beyond making a preliminary determination of the statute’s unconstitutionality or performing an act that would bring the constitutional issue to the *1125courts. Rather, city officials drastically and repeatedly altered the status quo based on their constitutional determination, issuing a multitude of licenses that purported to have an independent legal effect, contrary to their ministerial duty and statutory obligation and prior to any judicial determination of the statute’s unconstitutionality. By such dramatic overreaching, these officials trespassed on a core judicial function of deciding the constitutionality of statutes and endowed the issue of their authority to disobey the statute with a life of its own, independent of the underlying constitutional issue. I therefore agree with the majority that a writ of mandate is rightly issued against the city and its officials in this case.
I reiterate what is clear in the majority opinion. Our holding in this case in no way expresses or implies a view on the underlying issue of the constitutionality of a statute prohibiting same-sex marriage. That issue will be addressed in the context of litigation in which the issue is properly raised. (See Goodridge v. Department of Pub. Health (2003) 440 Mass. 309 [798 N.E.2d 941].)
The above dictum does not apply when the Legislature has required that a governmental entity challenge an assertedly unconstitutional statute by means of declaratory relief. (See, e.g., Rev. & Tax. Code, § 538 [county assessor to challenge constitutionality of state revenue statute by requesting declaratory relief under Code Civ. Proc., § 1060].)