Background: Animal rescue organizations that operated no-kill shelters filed a petition for writ of mandate against the county, seeking to compel the county to comply with statutory duty to release impounded dogs scheduled for euthanasia to animal rescue or adoption organizations with status as non-profit corporation under Internal Revenue Code unless the animal was irremediably suffering from a serious illness or severe injury. The Superior Court, Los Angeles County, No. 21STCP03313, James C. Chalfant, J., sustained county’s demurrer without leave to amend. Organizations appealed.
Holdings: The Court of Appeal, Moor, J., held that:
 county had a mandatory duty to release dogs scheduled for euthanasia to qualified nonprofit animal rescue or adoption organizations, but
 county had discretion to determine what qualified a non-profit organization as an animal rescue or adoption organization. Reversed and remanded with directions.
*1 Plaintiffs and appellants Santa Paula Animal Rescue Center, Inc. (SPARC) and Lucky Pup Dog Rescue (Lucky Pup) (collectively Appellants) appeal a judgment of dismissal following the trial court’s order sustaining, without leave to amend, defendant and respondent County of Los Angeles’s (the County) demurrer to Appellants’ petition for writ of mandate.
Appellants contend that the Hayden Act and, more specifically, Food and Agriculture Code 1 section 31108 and similar provisions2 impose on the County a ministerial duty to: (1) release a dog or other shelter animal3 to a requesting animal adoption or rescue organization with Internal Revenue Code section 501(c)(3) status prior to euthanasia without first determining whether the animal has behavioral problems or is adoptable or treatable, and (2) release the aforementioned animal to the requesting animal rescue or adoption organization without requiring the organization to meet qualifications additional to having Internal Revenue Code section 501(c)(3) status.
We conclude that the demurrer was improperly granted, because the County lacks discretion to withhold and euthanize a dog based upon its determination that the animal has a behavioral problem or is not adoptable or treatable. However, the County has discretion to determine whether and how a non-profit organization qualifies as an animal adoption or rescue organization. We reverse the judgment of dismissal, and we order the trial court to vacate its order sustaining the demurrer. The matter is remanded to the trial court for further proceedings consistent with the views expressed in this opinion.
FACTS AND PROCEDURAL HISTORY
Writ of Mandate
Appellants filed a petition for writ of mandate against the County containing the following allegations:
Appellants are nonprofit corporations under Internal Revenue Code section 501(c)(3). Appellants operate no-kill shelters dedicated to saving the lives of stray and abandoned animals, providing them with care and shelter, and re-homing the animals.
The County is charged with preserving and protecting animal and public safety, and with enforcing all state and local laws governing the animal shelter system.
Section 31108, subdivision (b)(1), which is part of the Hayden Act, imposes a mandatory ministerial duty on the County to release to an Internal Revenue Code section 501(c)(3) animal rescue or adoption organization any impounded dog scheduled for euthanasia, unless the dog is irremediably suffering from a serious illness or severe injury. The Hayden Act imposes the same release requirements for other shelter animals.
*2 The County routinely fails to perform this duty by enforcing a policy of only allowing Internal Revenue Code section 501(c)(3) animal rescue or adoption organizations that the County pre-approves as adoption partners to redeem animals scheduled for euthanasia. In August 2021, the County denied a request from Lucky Pup to obtain a dog named Derek, who was impounded at the County’s Downey Animal Care Center and scheduled for euthanasia, because Lucky Pup was not a pre-approved adoption partner. In September 2021, the County denied for the same reason Lucky Pup’s request for another impounded animal scheduled for euthanasia.
The County also routinely fails to perform its duty to redeem animals scheduled for euthanasia by denying the requests of Internal Revenue Code section 501(c)(3) animal rescue or adoption organizations that are pre-approved adoption partners, based on the County’s determination that certain animals have behavioral problems. In February 2020 and June 2021, the County denied pre-approved adoption partner SPARC’s requests to redeem dogs named Gunnar and Winston from the Agoura Animal Care Center because of behavioral problems. Both dogs were subsequently euthanized. The County’s failure to comply with the Hayden Act has resulted in unnecessarily high rates of euthanasia.
Appellants sought to compel the County to comply with the ministerial duties imposed by the Hayden Act, which Appellants argued require the County to release any shelter animal scheduled for euthanasia to an Internal Revenue Code section 501(c)(3) animal rescue or adoption organization without further qualification unless that animal is irremediably suffering from a serious illness or severe injury.
The County filed a demurrer to the petition for writ of mandate arguing that the Hayden Act does not preclude its use of standards (beyond Internal Revenue Code section 501(c)(3) status) to qualify particular organizations as animal rescue or adoption organizations. The County also argued that it is not precluded from refusing to release animals with behavioral problems, because the Hayden Act excludes animals with behavioral problems from being adoptable.
The County asserted that there is no mandatory duty to release animals to any entity that claims to be an Internal Revenue Code section 501(c)(3) animal rescue or adoption organization. Although the word “shall” is often considered mandatory, in the case of section 31108, the County must use discretion to carry out its duty. Section 31108 provides that the County “may” enter into cooperative agreements with animal rescue or adoption organizations, which also contemplates that there is discretion to be exercised in the County’s statutory duties. Moreover, the statutory scheme must be read as a whole. Section 17005, subdivision (a), Civil Code section 1834.4, subdivision (a), and Penal Code section 599d, subdivision (a), all state that it is California’s policy that no adoptable animal should be euthanized. These three sections define adoptable animals, in part, as animals that “have manifested no sign of a behavioral or temperamental defect that could pose a health or safety risk or otherwise make the animal unsuitable for placement as a pet[.]” It would be absurd to interpret section 31108, subdivision (b)(1), to require the County to transfer to non-profit agencies an animal that is not adoptable.
Appellants opposed the demurrer, arguing that the language of section 31108, subdivision (b)(1), imposes a mandatory duty on the County to release dogs prior to euthanasia, and the Hayden Act does not give the County any discretion in carrying out that duty. The Hayden Act extends this same duty to other shelter animals. The Legislature has set forth only three express exceptions to the requirement to release shelter animals, and there is no exception for animals with behavioral problems.
*3 The trial court sustained the County’s demurrer without leave to amend, and later dismissed Appellants’ entire action with prejudice.
This appeal requires us to answer two questions. First, does the County have discretion to refuse to release, and then to euthanize, a dog deemed to have behavioral problems when release has been requested by a non-profit animal adoption or rescue organization? Second, does the County have discretion to determine and impose requirements for organizations that claim to be animal rescue or adoption organizations to qualify as such, beyond simply ensuring that the organizations are non-profits under section 501(c)(3) of the Internal Revenue Code? We conclude that the Hayden Act vests the County with discretion to determine which organizations qualify as animal adoption or rescue organizations, but that once such organizations are qualified, the County has no discretion to refuse to release, and then to euthanize, a dog after a qualified organization has requested release of the animal.
Legal Principles & Standard of Review
“A writ of mandate ‘may be issued by any court ... to compel the performance of an act which the law specifically enjoins, as a duty resulting from an office, trust, or station ....’ (Code Civ. Proc., § 1085, subd. (a).) The petitioner must demonstrate the public official or entity had a ministerial duty to perform, and the petitioner had a clear and beneficial right to performance .... [¶] Generally, mandamus is available to compel a public agency’s performance or to correct an agency’s abuse of discretion when the action being compelled or corrected is ministerial. [Citation.] ‘A ministerial act is an act that a public officer is required to perform in a prescribed manner in obedience to the mandate of legal authority and without regard to his [or her] own judgment or opinion concerning such act’s propriety or impropriety, when a given state of facts exists. Discretion ... is the power conferred on public functionaries to act officially according to the dictates of their own judgment. [Citation.]’ [Citations.] Mandamus does not lie to compel a public agency to exercise discretionary powers in a particular manner, only to compel it to exercise its discretion in some manner.” (AIDS Healthcare Foundation v. Los Angeles County Dept. of Public Health (2011) 197 Cal.App.4th 693, 700–701, 128 Cal.Rptr.3d 292 (AIDS Healthcare Foundation).) “We independently review the petition to determine whether [Appellants have] stated a viable cause of action for mandamus relief.” (Id. at p. 700, 128 Cal.Rptr.3d 292.)
“A respondent may test the legal sufficiency of a petition for writ of mandate by demurrer. [Citation.] On appeal from an order of dismissal after a demurrer is sustained without leave to amend, our review is de novo. [Citation.] In performing our independent review of the [petition], we assume the truth of all facts properly pleaded by the [petitioner]. [Citation.] [¶] Further, ‘we give the [petition] a reasonable interpretation, and read it in context.’ [Citation.] But we do not assume the truth of ‘ “ ‘contentions, deductions or conclusions of fact or law.’ ” ’ [Citations.]” (Committee for Sound Water & Land Development v. City of Seaside (2022) 79 Cal.App.5th 389, 399–400, 294 Cal.Rptr.3d 215.)
*4 Whether section 31108, which provides for release of a dog to a non-profit animal rescue or adoption organization “impose[s] a ministerial duty, for which mandamus will lie, or a mere obligation to perform a discretionary function is a question of statutory interpretation. [Citation.] ‘We examine the “language, function and apparent purpose” ’ of the statute.” (AIDS Healthcare Foundation, supra, 197 Cal.App.4th at p. 701, 128 Cal.Rptr.3d 292.) “ ‘Even if mandatory language appears in [a] statute creating a duty, the duty is discretionary if the [public entity] must exercise significant discretion to perform the duty.’ [Citations.] Thus, in addition to examining the statutory language, we must examine the entire statutory scheme to determine whether the [County] has discretion to perform a mandatory duty.” (Ibid.)
A. The Hayden Act: Significant Provisions
The Hayden Act’s provisions are codified throughout the Civil Code, the Penal Code, and the Food and Agriculture Code. The parties’ arguments center around three provisions of the Hayden Act, which we set forth below, noting as relevant the context in which those provisions appear in the Food and Agriculture Code’s overall statutory scheme.
Section 31108, entitled “Holding period for impounded dogs,” provides, in relevant part: “Except as provided in Section 17006, any stray dog that is impounded pursuant to this division shall, before the euthanasia of that animal, be released to a nonprofit, as defined in Section 501(c)(3) of the Internal Revenue Code, animal rescue or adoption organization if requested by the organization before the scheduled euthanasia of that animal. The public or private shelter may enter into cooperative agreements with any animal rescue or adoption organization.” (§ 31108, subd. (b)(1); italics added.) The section appears in Food and Agriculture Code, Division 14, titled “Regulation and Licensing of Dogs.”5
Section 17006 provides in full: “Animals that are irremediably suffering from a serious illness or severe injury shall not be held for owner redemption or adoption. Except as provided in subdivision (b) of Section 31108 and subdivision (c) of Section 31752, newborn animals that need maternal care and have been impounded without their mothers may be euthanized without being held for owner redemption or adoption.”
Section 17005, entitled “Euthanasia,” states, in pertinent part, that: “It is the policy of the state that no adoptable animal should be euthanized if it can be adopted into a suitable home.” (§ 17005, subd. (a).) As relevant here, “[a]doptable animals include only those animals ... that ... have manifested no sign of a behavioral or temperamental defect that could pose a health or safety risk or otherwise make the animal unsuitable for placement as a pet[.]” The section also provides that [i]t is the policy of the state that no treatable animal should be euthanized,” and defines treatable animals to include “any animal that is not adoptable but could become adoptable with reasonable efforts.” (§ 17005, subd. (b).) Identical language regarding the policy of the state with respect to adoptable and treatable animals appears in Penal Code, section 599d, and Education Code, section 92657. Both sections 17005 and 17006 appear in Division 9 of the Food and Agriculture Code, titled “Animals Generally,” and within Chapter 7, which addresses “Estrays.”6
B. The Duty to Release
*5 Appellants focus on section 31108, subdivision (b)(1), and argue that the Legislature’s use of the word “shall” indicates that it intended to impose a ministerial duty on the County to release “any dog” upon request. The County urges us to interpret section 31108 as only requiring the release of dogs that are adoptable or treatable. The County argues, based on the policy language of section 17005, it may withhold and euthanize a dog that it determines has behavioral problems that pose a health or safety risk or otherwise make the dog unsuitable for adoption, because a dog with a behavioral problem is unadoptable by definition. The County further argues that its determination of which dogs are adoptable and treatable involves an exercise of discretion for which mandamus does not lie.
We agree with Appellants that the language, purpose, and history of the Hayden Act all lead to the conclusion that section 31108 imposes on the County a mandatory duty to release dogs to qualified nonprofit animal rescue or adoption organizations, and that the County lacks discretion to withhold dogs the County determines have behavioral problems or are otherwise not adoptable or treatable.
As used in the Food and Agriculture Code, the Legislature has defined “shall” as mandatory and “may” as permissive. (§ 47; but see In re A.V. (2017) 11 Cal.App.5th 697, 710, 217 Cal.Rptr.3d 704 [mandatory language confers discretion if mandatory construction is inconsistent with statute’s purpose]; Walt Rankin & Associates, Inc. v. City of Murrieta (2000) 84 Cal.App.4th 605, 614, 101 Cal.Rptr.2d 48 [context requires interpretation that statute permits exercise of discretion].) Here, the Legislature’s use of the word “shall,” in section 31108, subdivision (b)(1), imposes a mandatory duty on the County to release, upon request, “any dog” that is impounded to a nonprofit animal rescue or adoption organization before the animal is euthanized.
The only exceptions to the requirement to release “any dog” are expressly provided in the Food and Agriculture Code. Section 31108 states that it is subject to exceptions under the provisions of section 17006, which provides for euthanasia of animals suffering from serious illness or severe injury and newborn animals that need, but do not have, maternal care.7 (§ 31108, subd. (b)(2).) The Hayden Act contains only one other express exception to release: section 31108.5, subdivision (b), permits the immediate euthanasia of a dog relinquished by its owner “if it has a history of vicious or dangerous behavior documented by the agency charged with enforcing state and local animal laws.”8 The Hayden Act provides no other exceptions to the County’s duty to release dogs upon request. Had the Legislature intended to restrict the release requirement only to adoptable or treatable dogs, it could have done so. Looking at the language of the Hayden Act, the fact that the express exceptions to section 31108 do not include dogs that are unadoptable or untreatable indicates that it was not the Legislature’s intent to create these exceptions. (See People v. Flores (2022) 77 Cal.App.5th 420, 444, 292 Cal.Rptr.3d 488 [“ ‘the presence of express exceptions ordinarily implies that additional exceptions are not contemplated’ ”].)
The legislative history of section 31108 leads us to the same conclusion. In 2000, the Legislature considered, but rejected, language that would limit the animals that would be subject to release by County shelters to those that the County determined were “adoptable” and “treatable.” Such language was included in an early draft of proposed revisions to section 31108, subdivision (b)(1) in 2000, but excised in a later draft, never to resurface.9
*6 In light of the plain language and legislative history of section 31108, subdivision (b)(1), we are not persuaded by the County’s reliance on the general policy statement in the Hayden Act—preventing euthanasia of adoptable and treatable animals (§ 17005; Pen. Code, § 599d; Ed. Code, § 92657)—to reach the conclusion that only adoptable and treatable dogs must be released upon request. The structure of the Food and Agriculture Code reinforces our conclusion. The definitions of “adoptable” and “treatable” are set forth in the Food and Agriculture Code in the provision governing euthanasia of estrays (§ 17005, subds. (a) and (b)), yet not employed in the sections pertaining to the mandatory release prior to euthanasia of dogs (§ 31108, subd. (b)(1)) or cats (§ 31752, subd. (c)(1)). This suggests that the Hayden Act’s statement of legislative policy in section 17005 sets minimum standards applicable to the euthanasia of animals generally, but does not preclude additional protections against euthanasia for specific species. The policy need not be read as a limitation on protections against euthanasia for it to have meaning: it also has broad application to animals generally insofar as there are criminal laws involving malicious mischief (Pen. Code, § 599d, subds. (a) and (b)), and the establishment of the Animal Shelter Assistance Program for County Shelters, which admit all types of animals (Ed. Code, § 92657, subds. (a) and (b)). We reject the County’s argument that this general policy was intended by the Legislature to be used as an interpretive tool that limits the protection against euthanasia only to adoptable and treatable animals.
Imposing upon the County a mandatory duty to release dogs to adoption or rescue organizations is not incompatible with the general policy against euthanizing adoptable and treatable animals. Rather, we read the Hayden Act as providing the County access to additional resources, through cooperation with animal adoption and rescue organizations that focus on animals traditionally kept as pets, to determine whether dogs may be adoptable or treatable, and to prevent overuse of euthanasia, even in circumstances where the animal might not be adoptable or treatable. Rescue and adoption organizations may be better equipped to determine whether a dog is in fact adoptable or treatable, to treat those dogs that can be treated, or to rescue and care for dogs that cannot be safely adopted as pets. That the Legislature has permitted the County to form cooperative agreements with animal rescue and adoption organizations demonstrates its intent for these entities to work together to prevent the greatest number of animals possible from suffering euthanasia.
For all of these reasons, we conclude that section 31108 does not confer the County discretion to withhold a dog on the basis that the County has deemed it to have “behavioral problems” or has determined that it is unadoptable and untreatable. Rather, section 31108 imposes a mandatory duty on the County to release such animals upon request from a qualified organization.10
C. Discretion Relating to Qualifying Organizations
Appellants also contend that section 31108 does not permit the County discretion to set qualifications for approval of animal rescue or adoption organizations, but rather imposes a mandatory duty on the County to approve any organization that describes itself in such terms, so long as the organization is a non-profit as defined in section 501(c)(3) of the Internal Revenue Code. Appellants posit that the Hayden Act essentially deferred to the Internal Revenue Service the determination of which organizations should qualify as adoption or rescue organizations. We disagree.
Section 31108 explicitly defines the term “nonprofit” by reference the Internal Revenue Code. But the placement of that definition after the word “nonprofit” alone, and not in relation to modifying the phrase “animal rescue or adoption organization,” makes clear that the Internal Revenue Code has no role in the definition of such organizations. Nor do Appellants provide any support for, or common-sense reason to reach, the conclusion that the Legislature deferred to a taxing authority the determination of which organizations have the qualifications to rescue animals scheduled for euthanasia. Looking beyond section 31108, no other provision of the Hayden Act defines or explains what qualifies a non-profit organization as an “animal rescue or adoption organization.”11 Because the Hayden Act is silent on this point, the County must exercise its judgment to make that determination. The absence of specific direction from the Legislature demonstrates that the Legislature intended to confer discretion on the County in carrying out its statutory duty in this context.
*7 The second sentence of section 31108, subdivision (b)(1), further supports the conclusion that the County has discretion in its performance of the obligation to release animals in this respect—the County “may” enter into cooperative agreements with animal rescue and adoption organizations. Neither section 31108 nor any other provision of the Hayden Act proscribes the manner in which these cooperative agreements are formed, what provisions they may contain, or how to select the organizations with which the County would enter into such agreements. Rather, the Hayden Act leaves the County to exercise its own judgment. Given the breadth of the County’s duty to release “any dog,” granting the County the discretion to ensure that the entity to whom a dog is released appropriately qualifies as an animal rescue or adoption organization facilitates the safe and appropriate placement of dogs.
We conclude that the Legislature intended to confer discretion on the County to qualify organizations as animal rescue or adoption organizations through means that the County determines are appropriate.
The trial court’s judgment is reversed. The trial court is directed to vacate its order sustaining the demurrer without leave to amend. The matter is remanded to the trial court for further proceedings consistent with the views expressed in this opinion.
The parties shall bear their own costs on appeal.
RUBIN, P. J.
--- Cal.Rptr.3d ----, 2023 WL 6053506
1 All further statutory references are to the Food and Agriculture Code unless otherwise indicated.
2 Appellants’ petition for writ of mandate expressly cites to four provisions that Appellants contend mandate the release of animals to animal adoption or rescue organizations prior to euthanasia: section 31108 [dogs], section 31752 [cats], section 31753 [other named species (e.g., rabbits)], and section 31754 [owner relinquished animals of a species impounded by shelters].
3 For ease, we use the term “shelter animals” to encompass the animals referenced in sections 31108, 31752, 31753, and 31754.
4 The County’s request, filed on April 10, 2023, that we take judicial notice of Attorney General’s Opinion No. 18-1001, 105 Ops.Cal.Atty.Gen. 50 (Mar. 24, 2022) is denied. The County argues that opinions of the Attorney General are subject to judicial notice under Evidence Code sections 451 to 453. However, the only official act associated with the Attorney General’s opinion is the issuance of the opinion, not its substance. (Taxpayers for Improving Public Safety v. Schwarzenegger (2009) 172 Cal.App.4th 749, 771, 91 Cal.Rptr.3d 370.) Our denial of the request to take judicial notice does not prevent us from considering the Attorney General’s opinion for its persuasive value. (Natkin v. California Unemployment Ins. Appeals Bd. (2013) 219 Cal.App.4th 997, 1006, 162 Cal.Rptr.3d 367.)
5 Division 14.5, titled “Regulation of Cats,” contains a substantively identical provision relating to cats. (See § 31752.) Division 14.5 also includes section 31753 [relating to certain rabbits, guinea pigs, hamsters, potbellied pigs, birds, lizards, snakes, turtles, and tortoises] and section 31754 [relating to “any animal relinquished by the purported owner that is of a species impounded by public or private shelters”].
6 An “estray” is “any impounded or seized bovine animal, horse, mule, sheep, swine, burro, alpaca, llama, or goat whose owner is unknown or cannot be located.” (§ 17001.5.)
7 A parallel exception exists for cats under section 31752, subdivision (c).
8 With respect to stray cats, section 31752.5 provides for the possible euthanasia of a cat that the County verifies, by using a standard protocol, is a feral cat. (§ 31752.5, subd. (c).)
9 See Assembly Amendment to Senate Bill No. 2754 (1999-2000 Reg. Sess.) May 16, 2000, section 1 [including “adoptable and treatable” limitation]; Assembly Amendment to Senate Bill No. 2754 (1999-2000 Reg. Sess.) May 26, 2000, section 1 [excluding “adoptable and treatable” limitation].
10 Our ruling on the meaning of section 31108 is sufficient grounds to conclude that it was error to grant the County’s demurrer and enter judgment against Appellants. Accordingly, we do not reach a definitive interpretation of the provisions cited in Appellants’ petition relating to other shelter animals (i.e., §§ 31752 [cats], 31753 [rabbits and other identified species], and 31754 [owner relinquished animals]).
11 Section 30503, subdivision (a)(2), defines a “rescue group” in relation to the obligation to spay or neuter dogs; however, the definition applies for purposes of that section only.