Under these sections, the county counsel generally supplants the district attorney in the provision of civil legal services. ( Harvey v. County of Butte (1988) 203 Cal.App.3d 714, 720 [ 250 Cal.Rptr. 65].) Government Code section 26529 provides that in counties which have a county counsel, "the county counsel shall discharge all the duties vested in the district attorney by Sections 26520, 26522, 26523, 26524, and 26526.
" This provision reflects the fact that the duties of the district attorney may extend beyond those of public prosecutor (§ 26500) to the prosecution or defense of civil causes of action (see e.g. §§ 26520-26530; Harvey v. County of Butte (1988) 203 Cal.App.3d 714, 720 [ 250 Cal.Rptr. 65]) which may require the assistance of investigators (see § 26508). Employment in the latter capacity is outside the scope of "county peace officer" status for the apparent reason that the peculiar risks and stresses that attend an investigation in contemplation of a criminal prosecution do not extend to the investigation of civil matters.
(§ 26529.) In Harvey v. County of Butte (1988) 203 Cal.App.3d 714, the court summarized the duties of the county counsel in providing civil legal services to county officers: "The statutes which govern the provision of civil legal services to counties are contained in the Government Code. Unless otherwise provided, the district attorney, an officer of the county (§ 24000, subd. (a)), is charged with providing civil legal services to county government, e.g. defending and prosecuting litigation (§ 26521), advising the board of supervisors (§ 26526), and providing written opinions to county and district officers on matters pertaining to their duties (§ 26520).
Government Code section 24000 states in part that "[t]he officers of a county are: [¶] (a) A district attorney." (See also Harvey v. County of Butte (1988) 203 Cal.App.3d 714, 720, 250 Cal.Rptr. 65.) Counties of course are "legal subdivisions of the state" (Cal. Const., art. XI, § 1 ) and their police powers may be enforced only within their territorial limits.
It does not mean that every public expenditure which was not made with due care or reasonable diligence is a violation of duty; it simply means that when an expenditure of public funds is wholly unauthorized, the public official who authorized the expenditure can be liable for restitution if he or she acted unreasonably. (Harvey v. County of Butte (1988) 203 Cal.App.3d 714, 719, 250 Cal.Rptr. 65.) In sum, the doctrines of separation of powers, legislative immunity, and discretionary act immunity prevent courts from considering the wisdom of legislative and executive decisions, including those pertaining to compensation, which have been entrusted to the discretion of municipal authorities.