When 47-year-old Edward Vega arrived in jail, he couldn't quiet the voices in his head. He felt paranoid, as though he was losing control. "I knew if I didn't get my medication, I was going to hurt someone," says Vega.
He was right. A week after being arrested for alleged drug possession, Vega says, he assaulted a fellow inmate and ended up in isolation, which only made him feel worse.
Finally, a doctor prescribed medicines that Vega says helped. He'd been taking them on the outside until he ran out — just before he was arrested.
"The medication hasn't totally taken away the voices, but I am able to differentiate reality from fiction," says Vega, who was released three months ago.
The number of inmates in California who've been prescribed psychiatric drugs has jumped about 25 percent in five years, according to a recent analysis of state data. These inmates now account for about a fifth of the county jail population across the state.
The increase might be a reflection of the growing number of inmates with mental illness, though it also might stem from better identification of people in need of treatment, say researchers from California Health Policy Strategies, a Sacramento-based consulting firm.
Amid a severe shortage of psychiatric beds and community-based treatment throughout the state and nation, jails have become repositories for people in the throes of acute mental health crises.
The number of people with mental illness in jails and prisons in the U.S. is "astronomical," says Michael Romano, director of Three Strikes & Justice Advocacy Project at Stanford Law School, who was not involved in the research. "In many ways, the whole justice system is overwhelmed with mental illness."
Contributing to the problem in California is a 2011 federal court order, and a state decision a few years later, that had unintended consequences.
In 2011, the U.S. Supreme Court ordered California to reduce the prison population because of overcrowding that the judges said constituted cruel and unusual punishment. Three years later, a state proposition reclassified some felony crimes as misdemeanors. Taken together, that led to a huge influx of offenders going to county jails instead of state prisons.
The CHPS analysis, based on survey data from 45 of California's 58 counties, opens a window into how the largest state is coping with the influx.
"We think this is the first part of a more systematic discussion about what is going on in the jails and in the broader community with respect to mental health," says David Panush, a co-author of the report, which was funded in part by the California Health Care Foundation.
Far more people with mental illness are housed in jails and prisons than in psychiatric hospitals. Insufficient staff training and poor patient treatment have contributed to inmate suicides, self-mutilation, violence and other problems, say advocates for the mentally ill.
One oft-cited complaint is that inmates have poor access to psychiatric prescriptions to treat such conditions as schizophrenia, major depression and bipolar disorder.
Jail officials in California say they are trying to better identify incarcerated people who could benefit from such drugs. The numbers suggest the strategy may be working. According to the CHPS report, an average of 13,776 inmates in the 45 California counties were on psychotropic medications in 2016-2017, up from 10,999 five years ago.
But the portion of inmates taking psychotropic medicine varies widely by county — from 8 percent in Glenn County to 32 percent in Sonoma and Napa, according to the analysis. The report is based on data from the Board of State and Community Corrections, an independent state agency.
In Los Angeles County, whose jails have been described as the largest mental institution in the country, about 30 percent of the roughly 18,000 inmates are mentally ill and most of those diagnosed are on medication, says Dr. Joseph Ortego, chief psychiatrist for correctional health services in L.A. County.
Although some still are missed in the screening process, he says, the county jails have improved identification and treatment of inmates and expanded staffing as part of the department's 2015 settlement with the U.S. Department of Justice. The department had alleged inadequate mental health care and suicide prevention in the jails.
Overall, medications are likely under-prescribed in jails, psychiatrists say.
"You need enough mental health professionals to treat the very large numbers of mentally ill people in jails," says Dr. H. Richard Lamb, professor emeritus of psychiatry at the University of Southern California School of Medicine. "There probably aren't enough."
And the medications these doctors prescribe are a crucial aspect of treatment, Lamb says.
Some advocates for the mentally ill worry that the drugs are at times prescribed inappropriately. Zima Creason, president and chief executive officer of Mental Health America of California, says psychoactive medicines, though sometimes necessary, are no substitute for comprehensive care for jail inmates.
"Sadly, they just throw a bunch of pills at them because there is nothing else," she says, adding that jails should also be providing individual and group therapy, more time outside of cells and sufficient recreation time.
"Jail is not conducive for real recovery," Creason says. "We are never going to put a dent in the numbers unless we provide a therapeutic environment."
Like people who live outside the correction facilities, inmates can be subject to involuntary drug treatment, officials say, but only if a court deems that step appropriate.
County jail officials, including Dr. Alfred Joshua, chief medical officer for the Sheriff's Department in San Diego County, say the influx of mentally ill inmates and the rising need for psychotropic drugs stems from a lack of resources for patients in the community.
"When they have [an] exacerbation of mental illness, they do many times come into contact with law enforcement," Joshua says.
Some of the most common charges that bring people with mental illness to jail are drug offenses and parole violations. Those who are homeless frequently get charged with panhandling, public urination and related crimes.
In addition to trying to improve treatment inside the jails, Los Angeles and San Diego county officials say they are working more closely with community organizations to ensure inmates with mental illness get the services they need after their release.
Vega says a local community group, the Neighborhood House Association, was able to help in his case, ensuring he got his meds and other treatment.
"Without the medication," Vega says, "I would probably be right back in jail."
Kaiser Health News is an editorially independent program of the Henry J. Kaiser Family Foundation, a nonprofit, nonpartisan health policy research and communication organization not affiliated with Kaiser Permanente. You can follow Anna Gorman on Twitter: @annagorman.