From his cell at the D.C. jail, Kamal Dorchy has spent the past few days writing what he described as “goodbye” letters to his mother, father, ex-wife and 5-year-old daughter. He is afraid he could be the next to get sick.

Eight of his fellow inmates in the Southeast Washington jail have tested positive for the novel coronavirus within the past eight days, quarantined and weakened with fever or chronic coughing.

Dorchy, 44, says fear is pervasive, leaving many inmates as well as staffers worried that they, too, will succumb to the virus while inside the jail’s walls.

“It’s like a ticking time bomb in here,” said Dorchy, of Beltsville, Md. “Each day the inmates in general are a little more agitated. We are a little scared.”

Jails and prisons across the country have been scrambling to prevent the spread of the virus among inmates and staff. The D.C. jail announced its first case last week, and by Wednesday evening that number had grown to eight. Facilities in Maryland and Virginia saw their first cases this week.

In Virginia, an inmate in his 20s at the Fairfax County jail tested positive. County health officials said the man, who has been at the jail since Jan. 29, probably contracted the virus while incarcerated. And at the Virginia Correctional Center for Women in Goochland, three inmates had the virus.

In Maryland, a female inmate in the Prince George’s County jail has tested positive. And an inmate in Maryland’s state prison contracted the virus, as had two contract employees.

Corrections officials say they are taking various precautions, including isolating sick inmates, tracking whom they may have had contact with and monitoring the population for symptoms. Yet, even with extra cleaning and other efforts, officials are bracing for additional cases.

“I expect we’ll have more before this is over,” said Mary Lou McDonough, director of the Prince George’s County Department of Corrections. McDonough likened the close, enclosed quarters of jails to “cruise ships without the views or the amenities.”

As the virus threatens to proliferate behind the walls of detention facilities nationwide, attorneys and justice reform advocates have petitioned judges and prosecutors to step up efforts to seek release for inmates who are accused or convicted of minor crimes or are at higher risk for the virus, including the elderly or those with compromised immune systems.

In the District, attorneys have filed petitions in federal court and D.C. Superior Court seeking the expedited release of hundreds of inmates. On Monday, the city’s Public Defender Service teamed with the ACLU and filed a federal class-action lawsuit alleging the city has not done enough to fight the pandemic within the jail, which houses about 1,600 inmates.

That lawsuit against D.C. jail management requests that a federal judge appoint an “expert” over the jail to oversee petitions for inmate release, as well as the jail’s compliance with cleaning and disinfecting, and health screenings of inmates, staff and visitors.

During a federal court conference Tuesday, Andrew Saindon, an attorney for the D.C. Department of Corrections, told a federal judge that they were reviewing information regarding the release of 157 inmates who have earned credits for good behavior.

U.S. District Judge Colleen ­Kollar-Kotelly ordered correction officials to disclose all procedures and policies regarding the virus at the jail.

Meanwhile, in Superior Court, attorneys with the Public Defender Service also have filed a motion asking a judge to release many other inmates charged with misdemeanors. Prosecutors say those requests should be considered on a case-by-case basis.

D.C. officials said they could not comment on a pending lawsuit but defended the jail’s response.

“We can say that since the earliest stages of the unprecedented pandemic, we have been planning for the safety and well-being of all vulnerable populations in the District, which includes residents in the custody of the Department of Corrections,” Deputy Mayor Kevin Donahue said in a statement.

Meanwhile, corrections officials across the area have been implementing new procedures to protect inmates and staff. At various facilities, including in the District, officials have canceled in-person visits for inmates, tested or temporarily quarantined new detainees and provided inmate cleaning crews with disinfecting spray.

In the Prince George’s County jail, where 641 inmates are housed, corrections officers no longer line up for roll calls before shifts. During meals, inmates are encouraged to sit one or two per table. Inmates in double cells were asked to sleep in opposite directions on their bunk beds so their heads are farther apart. The jail also put its first covid-19 positive inmate in a cell where ventilation in the room generates negative pressure, allowing air to flow into the isolated area that does not circulate out.

McDonough, the county corrections director, started preparing for covid-19 in January before there were any confirmed cases in Maryland. In place of the in-person visits, she approved giving inmates — free of charge — three 10-minute phone calls a day to friends and family. Between calls, inmates are asked to clean the receivers with disinfectant wipes.

McDonough said officials may never know how the inmate at her facility contracted the virus. The belief is that the woman might have picked it up from an asymptomatic carrier in the jail.

Jails have an influx of people coming and going, including inmates, staff members, social workers and attorneys, all ushered through confined areas. “A jail is a pretty transitory place,” she said. “People are close together. You’re all breathing the same air.”

That circulating air is what concerns inmates such as Dorchy, who has preexisting health challenges. From inside the D.C. jail earlier this week, Dorchy called his mother, Lucretia, at home. His mother then telephoned The Washington Post, put her house phone on speaker and held her cellphone nearby to allow her son to speak to a reporter.

Dorchy, his mother said, has a blood disorder called leukopenia, which leaves his immune system weakened. She hopes he will be granted release and allowed to return home and placed on GPS monitoring. “If he doesn’t get out of there, that virus will kill him. My son is just waiting in there to die,” Lucretia Dorchy said.

Kamal Dorchy is charged with human trafficking and has been in the jail since July. He says he is innocent and was looking forward to trial. But now that local courts have largely shut down, it is unclear how long he will have to wait.

Like the six inmates who tested positive, Dorchy is housed in the jail’s Correctional Treatment Facility, or CTF, the medium-level security area of the facility located on the eastern side of the main jail known as the Central Detention Facility. CTF has 510 inmates, while Central Detention has 1,158, according to figures released Tuesday.

Because of federal health laws, jail officials are prohibited from identifying those inmates who test positive. Dorchy said a correctional officer told him that one inmate, who is Dorchy’s friend and worked on a cleaning detail, tested positive. Other rumors spread about which inmates had contracted covid-19.

Results for 10 inmates are pending, jail officials said.

Staff at the jail is affected as well. In addition to one correctional officer who tested positive, 103 officers are quarantined, city officials said.

J. Michael Hannon, attorney for the union that represents the jail’s 1,000 corrections officers, case managers and nonmanagement workers, said some fearful officers are using sick leave to avoid reporting for work. That forces others on duty to work 16-hour shifts.

On Tuesday, Hammon said, one area of the jail that should have had three officers working had one. He said some officers have been given gloves and paper masks, but not the N95 masks that federal officials say protects from the virus.

“A week or two from now, without any intervention by the courts, the jail will be unable to provide corrections officers to control the current inmate population,” he said. At a news conference Wednesday in the parking lot of the jail, Hannon said the union was supporting the federal lawsuit against jail officials after jail employees said management has ignored their concerns.

Former D.C. jail inmate Brent Jaffe was also housed in CTF. He was released Sunday after a federal judge put him on home confinement and GPS monitoring. Jaffe’s attorney made an emergency petition to the judge seeking Jaffe’s release, citing the virus influx at the jail.

Jaffe is charged with armed trafficking of marijuana and possession of a gun as a felon after police found a gun, which he said was not his, in his home, which he says he shared with roommates.

Jaffe, 33, of Northwest Washington, said inmates see possible risk all around. He said they worried about other potentially infected inmates and even about touching things such as plastic food trays. And those inmates who are part of the cleaning crews, he said, spray only casually as they disinfect.

“They are just spraying and wiping, not leaving the spray on the surfaces long enough to actually work,” he said.

Rachel Weiner and Justin Jouvenal contributed to this report.