A 76-year-old woman who was taken back into custody last month after not answering calls during a computer class from officials was ordered released Tuesday.

After serving 16 years in federal facilities for dealing heroin, Gwen Levi moved to Baltimore to live with her 94-year-old mother, build relationships with her sons and grandchildren, and volunteer at prisoner-advocacy organizations as she searched for a job. She was one of about 4,500 prisoners allowed to serve their sentences at home as the coronavirus swept through federal prisons, killing 240 prisoners and four Federal Bureau of Prisons staff members.

Her release, however, was revoked after she attended a computer word-processing class in Baltimore on June 12 and didn’t return calls from officials monitoring her.

Out of contact for more than four hours, according to a Federal Bureau of Prisons report, Levi was accused of “escape” and sent to the D.C. jail to await transfer back to the federal system. Her case drew attention after reports on former inmates who might have to go back to prison when the pandemic ends.

On Tuesday, court documents showed, a federal judge granted Levi compassionate release, reducing her sentence to time served. Levi’s request for release was filed before she was sent home last year.

Judge Deborah K. Chasanow, of the U.S. District Court for the District of Maryland, wrote that Levi “has done well on home confinement, the current question of the missed call notwithstanding.”

“Because of her release to home confinement, the most pressing initial concerns (COVID, age, and health) were addressed,” the opinion said. “The court concludes that it would do little (if anything) to serve the goals of sentencing to require her to return to full custody.”

Levi, due to be released Tuesday evening, was not immediately available to comment.

In an email, Justice Department spokesman Anthony Coley referred questions about Levi to the Federal Bureau of Prisons. In a tweet after Levi’s re-incarceration was reported late last month, he said that “inmates who have had their transfer to home confinement revoked based on a violation may appeal that decision through the Administrative Remedy Program based on the particular circumstances of their case.”

Levi’s attorney, Sapna Mirchandani of Maryland’s Office of the Federal Public Defender, said Levi elected to ask for a ruling on a long-pending motion for sentence reduction rather than pursue the appeal.

“If Gwen stayed in the BOP’s custody, we would go the ‘administrative remedy’ route, which is a painfully long bureaucratic maze that, in my experience, is a waste of time,” she said. “The BOP always backs up what the BOP does.”

Mirchandani said Levi will have to report to a probation officer for five years, but the terms of her release will be less restrictive. She also will be able to ask for early termination of supervision after one year.

Kristie A. Breshears, spokeswoman for the Federal Bureau of Prisons, declined to comment on Levi’s case. The Justice Department had opposed Levi’s motion for compassionate release, according to Chasanow’s opinion, noting a “criminal history that includes prior felony drug-trafficking and firearms convictions.”

“It did, however, acknowledge that she likely does not pose a significant danger to the community,” the opinion said.

Levi’s release comes as prisoner-rights advocates press President Biden’s administration to prevent inmates sent home during the pandemic from being returned to prison. They are asking for a change in policy established in the final days of Trump’s presidency.

On Jan. 15, a binding Justice Department memo called for nearly all people sent home because of the pandemic to return to prison when the public health emergency ends. The White House and the Justice Department have not said whether they plan to rescind the memo.

Breshears said 190 inmates sent to home confinement because of the pandemic have been returned to secure custody — 185 for alleged violations, five for alleged new crimes.

Kevin Ring, president of nonprofit prisoner advocacy organization Families Against Mandatory Minimums, said in a statement Tuesday that the bureau’s decision to send Levi back to prison was “shameful.”

“She deserves to be home,” he said.