California's San Quentin State Prison had zero coronavirus cases, until an inmate transfer in May sparked one of the worst outbreaks in the state and the country. Authorities are now scrambling to contain it.

Coronavirus: Can this California prison save itself from Covid-19?

On a typical morning, Jack Walter, 54, begins his day by going for a walk in the yard. At San Quentin State Prison, he and the roughly 3,500 other inmates share the communal outdoor space. "Four laps is around a mile," Jack said. "I walk about three miles and talk to the fellas." A short while later, Jack begins his work in the prison's canteen, a privilege he earned during his 24 years behind bars.

Even as the coronavirus outbreak ravaged California this spring, Jack's routine remained largely unchanged. Despite fears about virus spread in prisons, as late as May San Quentin had no reported cases. But in the last days of the month, 121 inmates from the California Institute of Men in Chino - then in the throes of its own outbreak - were transferred to San Quentin. Many of the men had not been tested for weeks prior to the move, state officials later confirmed, and the transfer sparked an outbreak that swept through more than one third of San Quentin's inmate population.

There have now been at least 2,159 confirmed cases of Covid-19 at San Quentin and 19 deaths. The prison, which sits in Marin County, 30 minutes north of San Francisco, is home to one of the worst outbreaks in the state and country.

On 6 July, about a month after the outbreak began, the state's most senior prisons medical official, Dr Steven Tharatt was fired. Later that month, all transfers to or from San Quentin were suspended indefinitely.

Prison authorities didn't test the prisoners before the transfer, according to Marc Levine, a California assemblyman for Marin County. "This ended up being the worst prison health screwup in the state's history," he said.

A spokeswoman for the California Department of Corrections and Rehabilitation (CDCR) declined to comment on the transfer.

Now, Jack's morning ritual has been upended. Inmates at San Quentin are largely limited to their cells, with the exception of communal showering. In an attempt to curb the spread of infection, the prison's yard is populated with tents that function as makeshift treatment sites.

Jack, who is serving a 27-year sentence for possession of a firearm, is locked in with a cellmate who recently tested positive for the coronavirus. After three tests, he said he was still "blessed" to be negative. "But they still locked us in this cell together," he said.

Four days later, a fourth test revealed Jack had contracted Covid-19. His wife, Teresa, 52, was distraught. "I just feel like screaming," she told the BBC. "They never moved his celly to the tents."

The speed with which the virus moved through San Quentin - the oldest prison in California - was exacerbated by the facility's swollen inmate population and decrepit infrastructure, said Dr Brie Williams, a professor of medicine at the University of California San Francisco and the director of Amend, and advocacy group that works with prisons on public health problems.

"People are living in often unsanitary conditions, often in very old buildings that have poor ventilation," she said. "These things in general are bad for health but when you put these against the backdrop of an emerging pandemic, a respiratory pandemic, then these problems become lethal."

Dr Williams was one of seven health experts to visit San Quentin in June, at the onset of the outbreak. The team wrote a nine-page memo in which they praised the prison's physicians and healthcare staff but warned that the facility had "profoundly inadequate resources", with "dire implications for the health of people incarcerated at San Quentin".

In the unit that housed the transferred inmates, the "fear and outrage" among the prisoners was "palpable", the memo said, with men heard "yelling throughout the housing unit due to discontent about the Covid-19 situation".

The BBC spoke to several family members of incarcerated men, who expressed concern after speaking with their loved ones in San Quentin.

"You just hear the alarms and 'man down' in the background," said the wife of an inmate on death row.

The anxiety among inmates was as endemic as the virus, Jack said. "You see people that are sick, but a lot of them don't want to say they're sick." He said that some inmates concealed their symptoms after hearing rumours that they might be placed in solitary confinement.

California Department of Corrections spokeswoman Dana Simas said in an email that San Quentin was "following isolation and quarantine protocols as recommended by the Centers for Disease Control and Prevention". She declined to comment on protocols for the newly infected, but referred to San Quentin's coronavirus response website, which said that areas of the prison had been designated to isolate infected inmates and those who had exposure to the virus.

According to Dr Williams, the health risks inside are aggravated by San Quentin's aging architecture. The nearly 170-year-old prison still houses some men in units built in the 19th Century. In two of the cell blocks, both with a capacity of 800 people, there are five floors of cells - 5ft by 11ft - typically home to two inmates. These cells have open-grills, meaning the men are held behind bars instead of a solid door.

"So what you have in this particular building is hundreds of people stacked in rows above each other with open bars where everyone is sort of breathing out into a common atrium," Dr Williams said. "People are yelling, or talking or interacting through the bars through the unit and the respiratory droplets are basically just existing in this open atrium."

And ventilation inside the prison was "exceedingly poor", the team found, with windows welded shut and fan systems that appeared to not have been turned on in years.

There are more than 104,000 people behind bars in California's 35 institutions, and roughly 2.3 million people locked up across the US. Per capita, the US has more citizens behind bars than any other country.

"Make no mistake, a public health disaster has already existed in the United States for decades, and that public health disaster has been mass incarceration," Dr Williams said. The coronavirus outbreak had "just opened people's eyes".