When the coronavirus pandemic began, Charles Ford had already been in jail in Alexandria, Va., for nearly a year awaiting trial on charges that he stabbed a friend in a dispute over a woman.

“It’s not a matter of if, it’s a matter of when” the virus gets into his jail, his defense attorney said in an April 2020 hearing, as he asked for Ford’s release.

The motion was denied, partly because Ford was still on probation for armed robbery and burglary. Over the next year, Ford’s first trial was cut short because two jurors had symptoms of covid-19. Then Ford contracted the coronavirus in jail. After arguing his innocence, he was acquitted at a March trial of a felony but convicted of a misdemeanor. He served 22 months on an effective sentence of six.

Ford briefly gained his freedom. But he soon went back to jail in Maryland on a charge that his conviction violated his probation there. “I still lost,” he said.

He was one of the first defendants to go before a jury after the coronavirus crisis largely halted such trials in the D.C. region and much of the country for a year.

The Constitution guarantees a right to a speedy trial, but courts across the country suspended those rights during the pandemic on the grounds that delays were unavoidable. Many people accused of nonviolent crimes were released from jail as their cases were pending. But others, like Ford, who faced serious charges and chose to exercise their right to a trial, remained behind bars.

As jury trials slowly ramp up, courts are now faced with decisions on how to prioritize cases. Some defendants who are ultimately convicted will have spent more time jailed than the sentences they are given.

In one dissent to a ruling allowing the suspension of the speedy trial clock, a D.C. federal judge noted that the delays “could mean the difference between a job and no job, or absence from the birth of one’s child, or the risk of being physically assaulted or contracting a deadly virus” for defendants who “will eventually be acquitted, have their charges dropped, or plead to charges carrying sentences that are less than the time they have already served pretrial.”

While jail populations declined early in the pandemic, University of Alabama School of Law professor Jenny E. Carroll said, they have crept back up — in part because fewer people are leaving.

“Everything is moving much more slowly than it used to,” she said.

In May, the federal court in D.C. held its first jury trial in over a year; a mentally ill man was found guilty of trespassing at the White House and threatening President Donald Trump. Held since 2017 because of competence issues, he will probably not receive more time in jail.

In state court in Alexandria, another defendant recently was convicted at trial of a misdemeanor protective order violation and released after a year in jail, the maximum sentence. City officials said most defendants who are being held awaiting trial entered the jail this year.

As of mid-June, 582 people were detained awaiting trial in D.C. Superior Court on felony charges, officials said. While most are accused of violent crimes, over 100 are being held on drug or gun possession charges.

Scheduling trials for those people “is our priority,” Chief Judge Anita M. Josey-Herring said in an interview, while noting that the court was open for pleas or dismissals during the pandemic. Two jury trials have been held since the court resumed them in April.

D.C. Superior Court Judge Juliet McKenna said there are “common-sense reasons” why the people in jail have remained there — either because of their criminal history, the victims involved or the seriousness of the charges.

To keep down the number of inmates and court hearings, the court is organizing a virtual check-in for people to resolve outstanding misdemeanor bench warrants.

Patrice Sulton, director of the advocacy group DC Justice Lab, said there was a “missed opportunity” for prosecutors to ask themselves whether convictions are necessary for people who have already served significant time.

“Is it really worth the expenditure, the time, the jurors’ time, to try the case just so the person will have the record of conviction?” she asked.

She is pushing for D.C. judges to have more power to dismiss or defer cases.

In D.C. federal court, judges have also warned about a backlog exacerbated by the Jan. 6 Capitol riot. About four dozen of those defendants are in custody, and some of their attorneys have voiced concern that they will spend more time in jail before trial than they will receive if convicted and sentenced.

“There’s going to be a lot of pressure on the system if the pleas don’t start to move,” U.S. District Judge Carl J. Nichols said June 1 in one such case.

Prosecutors say they base charges and plea offers on facts, not on external factors. But a spokeswoman for the U.S. Attorney’s Office for the District said prosecutors in their decision-making are “factoring in . . . the impact of the pandemic on all participants in the criminal justice system.”

Many defense attorneys did not push trials to resume during the pandemic, fearing for their own health and for the consequences of distracted jurors. Ford wanted to go to trial as quickly as possible.

He had gotten out of prison in 2017 and was working to pull his life together — reconciling with the mother who put him in foster care, getting engaged to a woman who worked at the Pentagon, getting a job at a bakery in the Capitol Hill neighborhood where he had once broken into houses.

While Ford was in jail, his fiancee left him, his bills piled up, and his credit score plummeted. After his release, he moved in with his sister while trying to find a job.

“It destroyed the foundation of everything that I built from before I got locked up,” he said.

Ford was arrested in May 2019, about a month after a street fight in the Arlandria neighborhood of Alexandria that left a man hospitalized with 13 stab wounds in his neck and back. Ford had been arguing with a friend over an apparent insult to a woman; witnesses later testified that Ford stabbed the other man repeatedly. But accounts conflicted and changed from one trial to the next, and the victim testified that he did not see who stabbed him. Attempts to reach the victim were unsuccessful.

Granting pretrial release is a judgment call with high stakes. Another inmate released from Alexandria during the pandemic went on to kill himself and the woman he was accused of sexually assaulting. A judge held Ford pending trial, questioning the weight of the evidence but citing the violence of the crime and his criminal record.

Ford’s first trial was set for November 2019. But on the eve of trial, according to court filings, his court-appointed lawyer said she had not had enough time to review materials recently handed over by prosecutors. His second lawyer quit the case last summer, saying there had been a breakdown in trust after he learned his trial would be delayed again by the pandemic.

That November, with a third lawyer, Ford went to trial. Two days into the case, a juror came down with covid-like symptoms. Not enough of the other jurors felt comfortable proceeding.

In the meantime, the Alexandria jail — spared a large outbreak earlier in the pandemic thanks to strict lockdown procedures — experienced dozens of covid cases. Ford said his symptoms were mild, but life in jail became worse — total isolation, terrible food.

His trial was rescheduled for March. Ford took the stand. While a majority of jurors wanted to convict him of the felony stabbing, according to two who spoke to The Post on the condition of anonymity, a handful were swayed by his testimony.

“His was the only coherent story,” said one juror, who asked to remain anonymous to protect her privacy.

He was sentenced to a year in jail, the maximum for a misdemeanor. In Virginia, every day served on a misdemeanor sentence counts as two, making Ford’s effective sentence only six months.

“Almost four times the sentence is what he served,” Ford’s trial attorney, Sebastian Norton, said. “And there’s really no recourse.”

Keith L. Alexander and Spencer S. Hsu contributed to this report.