ALEXANDRIA, Va. (AP) — A federal judge has ordered the immediate release of a computer hacker who was sentenced to 20 years in prison for helping the Islamic State, and accused the Justice Department of trumping up charges against him to keep him in jail.

The April 1 order from U.S. Judge Leonie Brinkema includes a harsh rebuke of the Justice Department’s conduct against Ardit Ferizi. The native of Kosovo is the first person convicted in the U.S. of both computer hacking and terrorism charges.

He pleaded guilty back in 2016 and was sentenced to 20 years in prison. He admitted hacking a private company and pulling out the names, email passwords and phone numbers of about 1,300 people with .gov and .mil addresses and turning the data over to the “Islamic State Hacking Division.” The Islamic State published the names with a threat to attack.

In 2020, in the earliest stages of the pandemic, Ferizi sought compassionate release, citing his asthma and obesity as placing him at greater risk of contracting COVID-19.

Brinkema initially denied his request. But Ferizi renewed his request when an outbreak spread through his prison, and Brinkema granted him compassionate release over prosecutors’ objections.

Brinkema’s ruling resulted in Ferizi’s transfer to immigration authorities for deportation. Before he could be deported, though, federal prosecutors in California brought new charges against Ferizi. The criminal complaint accused him of identity theft and wire fraud by coordinating with a family member to preserve access to email accounts that included large amounts of stolen data.

Ferizi’s lawyers filed to have the new charges dismissed, accusing the Justice Department of vindictive prosecution because agents were upset by Ferizi’s early release.

On March 22, just before a court hearing was scheduled in California to consider the accusation of vindictive prosecution, the new charges against Ferizi were all dropped.

In her April 1 order, Brinkema said prosecutors in California built their case on information from a fellow inmate of Ferizi with a history of unreliability.

She wrote that the circumstances of the case lead her to conclude that “there were elements within the Department of Justice who were so dissatisfied with this Court’s decision to release defendant … that they purposely tried to evade these decisions by filing very weak new charges against the defendant.”

Prosecutors have argued that, now that the pandemic has subsided, the rationale for compassionate release no longer exists.

Brinkema, though, said “it would set a terrible precedent to reverse the decision to release a defendant based on a change of circumstances caused by the government’s manipulation of the criminal justice system.”

Prosecutors, who filed an appeal with the 4th U.S. Circuit Court of Appeals in Richmond the first time Brinkema ordered Ferizi’s release, have not yet indicated if they plan to appeal her most recent order.

Ferizi was among a relatively small number of inmates who successfully sought early release from prison under the pandemic. According to the U.S. Sentencing Commission, more than 12,000 inmates filed motions for compassionate release in 2020 because of the pandemic. About 21% of those requests — a little more than 2,500 inmates — were granted.

A public defender representing Ferizi and a spokesperson for the U.S. Attorney for the Eastern District of Virginia each declined comment.