The mayor’s office has asked the courts to release some older defendants from the Rikers Island jail, where most of the city’s 5,400 inmates are housed closely together, guarded by thousands of corrections officers.

Coronavirus has utterly disrupted the criminal justice system, leaving crowded courts, prisons and jails especially susceptible to the outbreak. In New York and across the country, officials have had to improvise to keep the system running, struggling to balance the need to maintain public order and ensure people’s rights with growing concerns about public health.

In the past two weeks, in New York and other cities, the courts have not quite come to a halt, but they have slowed to a crawl. Trials have been delayed, grand juries have been put on hold, and sentencings have been postponed. Judges have been urged to avoid conducting hearings in person.

Defendants charged with less serious crimes in New York may end up released from pretrial custody because no grand jury can meet to indict them, officials and legal experts said. Other defendants could find themselves languishing in jail for extra weeks or months before a trial.

The governor in the coming days may have to decide whether to suspend New York’s criminal procedure law so that defendants accused of serious crimes who have not yet been indicted can continue to be detained. That happened after the Sept. 11, 2001, attacks and after Hurricane Sandy in 2012.

Already, two special state courts — in midtown Manhattan and Red Hook, Brooklyn — have been set aside as isolation areas for newly arrested people who are showing symptoms of the virus.

“It’s an extraordinary circumstance we’re going through, especially because there’s no end in sight,” said the Queens district attorney, Melinda Katz. “This is a fluid situation, and I don’t think there are any easy answers.”

State and federal courts generally remain open, but posters outside the courthouses said people with flulike symptoms should not enter the building. Still, there were no obvious signs of enforcement of that rule, and city courthouses this week were filled with the sound of coughing.

Civil courts and family courts are holding hearings only on important matters like child protection proceedings. And housing courts have been scaled back too, as evictions statewide stand suspended until further notice.

Court technicians are scrambling to set up monitors for video conferencing to link inmates in jail to prosecutors and defense lawyers in a physical courtroom.

Cyrus R. Vance Jr., the Manhattan district attorney, is laying down plans to allow prosecutors and investigators to work remotely on broad investigations, according to his chief assistant, Karen Friedman Agnifilo.

Defense lawyers, meanwhile, have been pushing to free people from jail who might be at risk if they get the disease. The first case of the coronavirus among inmates on Rikers Island was diagnosed Wednesday: a man who had contact with dozens of other detainees. Three correction officers and a captain have also been infected with the virus.

On Wednesday night, Mayor Bill de Blasio said he would work with district attorneys and the courts to release “vulnerable” inmates within the next 48 hours to curb the spread of the infection in the city jails. Los Angeles has already taken similar steps.

The Brooklyn district attorney, Eric Gonzalez, said this week that his office would stop prosecuting low-level, nonviolent offenses, including trespassing and shoplifting.

Still, law enforcement officials said some arrests will go forward, especially in cases of violent crime.

On Wednesday, federal prosecutors in Manhattan and state prosecutors in the Bronx announced a joint takedown of 14 defendants who were accused of involvement in a gang that carried out murder and assault. Eight defendants were led into federal court to be arraigned, one by one, wearing face masks.

The decision to postpone most trials, though sensible from a public health standpoint, could ultimately lead to complications should the defense decide to argue that the measure violates speedy trial rules, legal experts said.

The suspension of grand juries also raises serious legal issues, the experts said.

In New York, state prosecutors have 120 hours to either indict or release a defendant held in jail on a felony charge. But under the new rules put in place because of the coronavirus, grand juries in New York can be convened only under “exceptional circumstances,” and those have not yet been defined.

Tina Luongo, chief criminal defender of the Legal Aid Society, said police and prosecutors should not “add a single person to Rikers at this point.”

“The real concern is what is the effect of arresting someone and setting bail and there is not going to be a grand jury impaneled,” she said.

On Wednesday, David M. Hoovler, president of the District Attorneys Association of New York, sent a letter to Gov. Andrew Cuomo asking him to issue an executive order that would suspend the 120-hour rule for indictments as well as delay speedy trial deadlines. The group also asked the governor to relax rules that require prosecutors to turn over evidence and information about witnesses to the defense.

“I cannot stress the urgency behind the need to act on this matter to ensure that justice is served and that we are minimizing the spread of COVID-19,” Hoovler wrote.

Richard Azzopardi, a senior adviser to Cuomo, said, “We’re reviewing the situation.”

As caseloads have shrunk and the city’s bustling courthouses have largely emptied out, the few people who have had no choice but to go into the courts have encountered unsettling scenes.

In Brooklyn criminal court this week, for instance, a woman in a surgical mask waited in the hallway for her daughter’s arraignment, coughing repeatedly.

Lawyers wearing latex gloves whispered into their clients’ ears, next to a dwindling bottle of hand sanitizer. At one point Monday afternoon, 22 people crowded before the judge in a stuffy courtroom.

In a Manhattan courthouse, a defense lawyer stricken with a fever and cough quarantined himself in a private room with a speakerphone and tried to continue to defend his client, a doctor on trial on charges of sexually abusing a patient.

The judge, Ruth Pickholz, ended up declaring a mistrial when the lawyer, Donald Vogelman, was unable to hear a witness properly.

(BEGIN OPTIONAL TRIM.)

Moments later, Vogelman erupted into a coughing fit.

“You should leave the building now,” Pickholz said.

The defendant, Eric Braverman, asked for a new lawyer to finish his case.

“Your honor, there will be a three-month delay minimum until I get a trial,” he said.

The judge denied his plea.

(END OPTIONAL TRIM.)

Other judges and juries have raced to wrap up trials that started before the pandemic hit the city. In a federal sex trafficking trial in Brooklyn, jurors began deliberating last Friday and opted to stay late, reaching a verdict around 10 p.m.

Some trials were put on hold.

On Monday, a federal judge in Manhattan suspended a sex-trafficking trial, ruling that the jurors would be unable to deliberate safely in the jury room and could be too anxious about infection to focus on reaching a verdict.

“It is untenable to continue with this trial now or at any time as long as the current public health crisis persists,” Judge Paul A. Engelmayer said.

In another trial in the same court, Judge Alison J. Nathan made an apparently unprecedented decision: She allowed an ailing juror to continue deliberating remotely, using FaceTime.

(STORY CAN END HERE. OPTIONAL MATERIAL FOLLOWS.)

“We are under extraordinary circumstances,” she explained.

The court system has also struggled with absences as employees quarantine themselves, from janitors to judges. Even the chief judge of the Southern District federal court, Colleen McMahon, worked for several days this week under a self-imposed quarantine.

McMahon, 68, isolated herself last week after learning that a friend she sang with in her church choir practice was ill and awaiting testing.

The judge set herself up in her Manhattan apartment, running operations from her dining room table. She returned to work Thursday.

During her quarantine, she said, she had been “sharing the experience of everyone who is working remotely.”

This article originally appeared in The New York Times .