A Mendocino County ballot initiative that would have funded the construction of mental health and drug rehabilitation facilities through a countywide half-cent sales tax barely failed to capture the two-thirds vote it need to pass, county elections officials said Thursday.

Measure AG earned 24,190 “yes” votes out of a total 36,532 votes cast, which is 66.22 percent of the vote. It needed 66.67 percent and missed that mark by about 165 votes.

The initiative would have raised $37 million over five years for construction of an array of mental health and substance abuse facilities, including a 16-bed psychiatric hospital, a 12-bed mental health crisis residential unit, a 12-bed alcohol-and-drug residential unit, a new mental health outpatient clinic, and a facility for training police and mental health workers in how to better respond to mental health crises.

The measure was strongly supported by Mendocino County Sheriff Tom Allman who argued that the dearth of these services has resulted in more people with mental illness ending up in jail or hospital emergency rooms.

“It’s certainly disappointing that a third of our county doesn’t realize that the mental health situation we’re in is as close to critical as I’ve ever seen it,” Allman said.

Critics of the measure had called for voters to reject it because none of the funds raised by the tax was to be used for staffing and operations at the facilities, which would have cost about $4.8 million, according to the county auditor.

Supporters of Measure AG, however, said federal grants and other funding sources could have covered the bulk of that cost.

Mendocino County shuttered its previous psychiatric hospital in 1999, citing costs.

Patients in acute crisis are usually held in a local hospital until a bed can be found for them in a psychiatric facility outside the county.

Mentally ill residents often end up in jail for minor crimes when their condition becomes progressively worse from lack of treatment.

You can reach Staff Writer Martin Espinoza at 707-521-5213 or martin.espinoza@pressdemocrat.com.