Michael Avenatti, the lawyer for adult film star Stormy Daniels who is serving time for trying to extort Nike, has been granted temporary release from the Metropolitan Correctional Center in New York City amid fears he might contract COVID-19, according to a court order signed by a California judge late Friday.

Avenatti will have to spend 14 days in quarantine at a Federal Bureau of Prisons facility to make sure he is not infected with the coronavirus before he can return to Los Angeles for 90 days. His $1 million bail was paid by banker Hubert Bromma, author of the book How to Invest in Offshore Real Estate and Pay Little or No Taxes and self-described “pioneer in the field of alternative investments in tax-free and tax-deferred environments.”

He will be confined to the personal residence of his childhood friend, Jay Manheimer, in Venice, California.

Avenatti first petitioned the court for his release so he could avoid “disastrous health consequence” in early April, saying he had suffered from pneumonia six months earlier, which made him susceptible to COVID-19.

Coronavirus has spread rapidly through New York’s prison system, prompting a judge to release at least one other high-profile inmate, rapper Tekashi69.

Judge James V. Selna of U.S. District Court in Santa Ana initially said Avenatti posed “a danger to the community” and could not be released unless he could post $1 million bond secured by at least half a million in real estate or hard assets.

At the time, Avenatti’s lawyer, H. Dean Steward, told the judge, “Frankly, your honor, we can’t meet this.” It is unclear what obligation Avenatti now has to the author Bromma, who secured the bond.

Among the stipulations of his release laid out in the court order, seen by The Daily Beast, are his need to secure advance permission to travel and to wear an ankle monitoring bracelet. He is not allowed to leave Manheimer’s house and he is prohibited from using the internet, from opening any bank or credit card accounts, or from engaging in any transaction worth more than $500.

In an email to The Daily Beast on Saturday, Steward said he expected Avenatti would be released next week.

“Our goal has been to prepare for the two upcoming trials,” he said. “The release of Mr. Avenatti will help us complete that preparation.”

Avenatti represented Stormy Daniels in her lawsuit against President Donald Trump. He was later found guilty of wire fraud, extortion and transmitting a threat in interstate communications in his failed attempt to extort sportswear company Nike. He was due to be sentenced on June 17.

He faces two other pending criminal cases in New York and California, where he’s charged with stealing money from several of his clients—including Daniels, who claims he swiped $300,000 from her book advance.

Federal prosecutors had opposed Avenatti’s release, arguing that the celebrity lawyer had shown disregard for the court by trying to hastily organize a release without securing a bond, arranging a self-quarantine or allowing the government to properly vet Bromma and Manheimer.

“Defendant and his counsel continue to demonstrate that they are either unable or unwilling to follow this Court’s directions, thereby wasting valuable judicial and government resources during a time when such resources are already stretched thin,” prosecutors wrote in their court filing.

A spokesman for the United States Attorney’s Office for the Central District of California, Los Angeles declined comment to The Daily Beast on Saturday.