
261 Cal.App.2d 274 (1968)
DONALD WILLIAM CULBERTSON, Plaintiff and Appellant,
v.
COUNTY OF SANTA CLARA, Defendant and Respondent. [261 Cal.App.2d 275]
Civ. No. 23805. 
California Court of Appeals. First Dist., Div. Three.  
Apr. 18, 1968.
 Marshall W. Krause and E. Myron Bull, Jr., for Plaintiff and Appellant.
 Hoge, Fenton, Jones & Appel and Charles H. Brock for Defendant and Respondent.
 DRAPER, P. J.
 The complaint alleges that on May 28, 1965, upon the filing of a petition (Welf. & Inst. Code,  5551) by a deputy sheriff, an order for examination and detention of plaintiff (Welf. & Inst. Code,  5554) was issued by the superior court.plaintiff was taken into custody at his home, and was delivered to Agnews State Hospital, where he was held for some days. A hearing was noticed and held.plaintiff was released and the proceedings dismissed, without adjudication of mental illness. He brought this action against the county for damages for false imprisonment. The county's general demurrer was sustained without leave to amend.plaintiff appeals.
 We look only to the allegation that plaintiff was never served with any order of detention or petition for examination. It is conceded that no relative or friend was ever so served. [1] But the code affirmatively requires such service (Welf. & Inst. Code,  5050.2, as it stood before and after May 28, 1965).
 Respondent county argues that since the order of detention is valid on its face, there can be no liability for its execution by a deputy sheriff. We readily recognize the rule that law enforcement officers are not required, at their peril, to determine the propriety of an apparently valid order issued by a court (Vallindras v. Massachusetts etc. Ins. Co., 42 Cal.2d 149, 154 [265 P.2d 907]). But the defect here alleged is not in the court order. Rather, the deficiency lies in the failure of the deputy sheriff to perform the duty specifically imposed upon him by the statute. The statutory mandate is clear and direct.
 Service of notice of hearing (which would have been effected by service of the required documents) is essential to a valid detention order in a mental illness proceeding (see In re Hofmann, 131 Cal.App.2d 758 [281 P.2d 96]).
 Hofmann was a proceeding in habeas corpus. Respondent seeks to distinguish it upon the rule that discharge from a criminal commitment on habeas corpus does not establish a right to damages in a civil action (Vallindras v. Massachusetts etc. Ins. Co., supra). Here, however, we do not deal with *276 detention on criminal charges, but with a special civil proceeding in which "jurisdiction ... depends on strict compliance with each of the specific statutory prerequisites for maintenance of the proceeding" (see In re Raner, 59 Cal.2d 635, 638-640 [30 Cal.Rptr. 814, 381 P.2d 638]; In re De La O, 59 Cal.2d 128, 150 [28 Cal.Rptr. 489, 378 P.2d 793, 98 A.L.R.2d 705]). [2] A specific requirement of the statute directs service of order and petition upon the one assertedly mentally ill. Failure of the deputy sheriff to effect such service, if proven, necessarily renders wrongful his detention of plaintiff. The gravamen of the complaint is his personal failure to comply with the statutory mandate. Although the officer is no longer a party defendant, it is conceded that the county is liable if he would be (Gov. Code,  815.2).
 The decision relied upon by respondent (Whaley v. Kirby, 208 Cal.App.2d 232 [25 Cal.Rptr. 50]) is inapplicable. That case quotes and turns upon a code section permitting detention upon probable cause apparent to the officer. No such provision is involved here.
 We conclude that the count for false imprisonment states a cause of action against defendant county. Respondent does not contend that it is entitled to immunity from liability for false arrest or imprisonment, nor would such a claim be sound (Gov. Code,  820.4; see Shakespeare v. City of Pasadena, 230 Cal.App.2d 375, 382-383 [40 Cal.Rptr. 863]). The demurrer to the count for malicious prosecution was properly sustained (Shakespeare v. City of Pasadena, supra, p. 382-383), and plaintiff so concedes. In reversing, of course, we do not suggest that the allegation of lack of service is or can be established. We hold only that the allegation raises a triable issue of fact, and bars sustaining of a general demurrer.
 Judgment reversed as to count for false arrest or imprisonment, and in all other respects affirmed.
 Salsman, J., and Brown (H. C.), J., concurred.
