(Reuters) - The convicted celebrity lawyer Michael Avenatti has been granted temporary freedom from a New York City jail by a California federal judge who said the spread of the novel coronavirus was a compelling reason to release him.

FILE PHOTO: FILE PHOTO: Attorney Michael Avenatti exits the United States Courthouse in the Manhattan borough of New York City, U.S., October 8, 2019. REUTERS/Brendan McDermid/File Photo

In an order late on Friday, U.S. District Judge James Selna said Avenatti, who represented adult film actress Stormy Daniels in lawsuits against U.S. President Donald Trump, may stay at a friend’s home during the 90-day release period.

Avenatti, 49, must first be quarantined for 14 days at a Federal Bureau of Prisons facility, to ensure he does not have the coronavirus or symptoms, before moving to the home of Jay Manheimer in Venice, California.

Selna, who has called Avenatti a “danger to the community,” said the lawyer would wear an electronic monitoring bracelet, have no internet access, and except for health emergencies be unable to leave Manheimer’s home without permission. Bond was set at $1 million.

Avenatti was convicted in February of trying to extort up to $25 million from the athletic wear company Nike Inc NKE.N.

He still awaits criminal trials in Manhattan on charges he defrauded Daniels, whose real name is Stephanie Clifford, and in Santa Ana, California on charges he defrauded other clients and lied to the Internal Revenue Service and a bankruptcy court.

“Our primary concern has been to prepare for the upcoming trials,” Avenatti’s lawyer Dean Steward said in an email on Saturday. “Mr. Avenatti’s release will help us build our defense.”

The U.S. Department of Justice agreed to the release terms.

Avenatti has been housed since mid-January at the Metropolitan Correctional Center in Manhattan, after Selna revoked his bail in the California case following accusations by prosecutors that Avenatti hid money from creditors.

During his temporary release, Avenatti would be unable to conduct any transactions exceeding $500.

In court papers, Avenatti had said he was at “extreme risk” of contracting the coronavirus at the Manhattan jail, which is often criticized for cramped and unsanitary conditions.

He is one of several celebrity inmates who have recently sought release from U.S. jails and prisons, saying the facilities could become flashpoints for the coronavirus.

Trump’s former personal lawyer Michael Cohen and R&B singer R. Kelly have had their requests denied, while the rapper Tekashi69, who has asthma, was released early from his two-year term. The comedian Bill Cosby has also sought freedom.