As the COVID-19 pandemic swept into Montana, it spread into the Marias Heritage Center assisted living facility, then flowed into the nearby 21-bed hospital.

Toole County quickly became the state’s hot spot for COVID-19 deaths, with more than four times the infection rate of all other counties and the most recorded deaths in the state. Six of the state’s 16 COVID deaths through Tuesday have occurred here.

But another danger loomed: What if it got into the prison, less than 4 miles away from the hospital and assisted living facility? The county was nearly overwhelmed as it was. Across rural America, prisons and jails sit in places like Toole County that have minimal intensive care unit beds and ventilators and few additional medical resources. Many hospitals there were strained before the pandemic.

This rural, 5,000-person county tucked under the Canadian border might not have seemed like a breeding ground for the contagion. It is a primarily agricultural community almost twice as large as Rhode Island situated in the Great Plains under a big Montana sky. Some areas of the county don’t have cellphone coverage, much less internet, and winters are cold enough that people plug in their cars not because they are electric but because they must heat the engines to keep them from freezing.

“When you look at the per capita infection rate in the county and deaths, unfortunately, in our community, it’s very, very staggering,” said William Kiefer, CEO of the Marias Medical Center, which is affiliated with the assisted living facility. “And the impact is clearly similar to what’s happening in some of the urban areas that have been hit really hard.”

The two original cases of COVID-19 at the assisted living facility exposed 63 staffers at the center and the affiliated hospital. Thirteen tested positive, and one was hospitalized. All of them recovered. It took a monumental effort by the entire county to keep the hospital from shuttering.

At the worst point, Kiefer and his CFO were the only original staff members not quarantined and able to work. The Montana National Guard helped wash laundry, former employees came out of retirement to fill in, nurses worked as many as five different roles for weeks on end, and quarantined staff coordinated administrative work from sunup to sundown while isolating from their families.

But, through it all, the dreaded coronavirus hasn’t yet crept into the site of one of the community’s largest employers, the Crossroads Correctional Center prison. It holds almost 15% of the county’s total population with a 712-bed facility for both federal and state inmates.

Almost 70% of the nation’s more than 1,100 prisons are located outside of metropolitan areas, according to 2017 research by John M. Eason, an associate professor in sociology at the University of Wisconsin-Madison. A building boom occurred from 1980 through 1999 as struggling towns eyed prisons as economic salvations.

“It’s going to be a nightmare because rural communities are so disadvantaged,” Eason said. “We’re going to see a lot of people in prison contract and die of COVID.”

It is not just the inmates behind bars, but also the people in the surrounding community, many of whom work at the facilities, who would be at risk. The employees leaving prisons and jails daily could spread the virus to inmates on the inside and community members on the outside. Already such rural communities on average have sicker and older populations than the rest of the country, even before considering the added risk of close-quartered prisons and jails.

“What is at stake is, in some way, always what’s been at stake,” said Jessica Pishko, the senior legal adviser at the Justice Collaborative, a nonprofit focused on the justice system. “The most vulnerable are already the ones who are the most impacted.”

The Justice Collaborative released a report last month finding that 12% of people held in jails are in counties without intensive care unit beds. In Montana, the report said, over a third of jail detainees are in counties without them. And Toole County has none. Jails, which hold people pretrial, often have a higher rate of turnover of inmates moving in and out of the facility than prisons, increasing the chance of spreading the disease. Still, prisons have similar difficulties with COVID-19 prevention inside facilities.

Of course, not all people infected with the coronavirus end up in need of intensive care, but even a small number of serious cases in a small jail or prison could overwhelm limited resources.

“You can’t just airlift 10 people to another hospital,” Pishko said.

The Marias Medical Center has two ventilators and added a six-bed COVID-19 isolation tent behind the hospital. It has two regular staff nurses. But, like many rural hospitals, it is designed to stabilize patients and then transfer them to other, bigger hospitals, if needed. Those are some 80 and 160 miles away.

COVID-19 has only magnified the existing resource problems of the medical center.

“We almost got pushed to the limit where we didn’t have sufficient staff to maintain our emergency room open, and that would be catastrophic to a community,” Kiefer said.

In normal times, the facility saw about five of the prison’s inmates a month in the emergency room. Now, amid the pandemic, officials from the medical center and county have been coordinating with the company that runs Crossroads to form plans in case a new wave of COVID-19 compromises the facility. Ryan Gustin, a spokesperson for CoreCivic, which runs Crossroads, said they are all sharing information to “strengthen our collective response.”

The Montana Department of Corrections also helped the private prison distribute educational materials, such as newsletters detailing information about the virus and prevention. As of Monday, no inmates had tested positive in Montana state-run facilities and three staff had tested positive.

Even so, Toole County Health Department interim director Blair Tomsheck wrote in an email that “any outbreak has the potential to overwhelm our medical resources.”