Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Rapper Tekashi 6ix9ine was released into house arrest Thursday over fears that his chronic asthma makes him vulnerable to the coronavirus.

"He's out and he's very happy to be released," his defense attorney, Lance Lazzaro, told NBC News.

The 23-year-old rapper, whose real name is Daniel Hernandez, had been housed at a private facility under contract with the federal Bureau of Prisons. He was serving time after pleading guilty to multiple counts of racketeering, firearms offenses and drug trafficking.

Citing safety concerns, Lazzaro declined to reveal which private lockup his client had been at and refused to say where he would stay for the final four months of his two-year sentence.

Full coverage of the coronavirus outbreak

U.S. District Judge Paul A. Engelmayer had earlier written that he didn't have legal authority to change the sentence, and he told Hernandez's defense team that it first had to ask the Bureau of Prisons to let him out because of the pandemic.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But once the bureau refused the request, Engelmayer said, the court was allowed to act.

"It is readily apparent — and the Court here finds — that the circumstances presented here are extraordinary and compelling so as to justify compassionate release in Mr. Hernandez's case," Englemayer ruled Thursday in New York City.

"The COVID-19 pandemic is extraordinary and unprecedented in modern times in this nation. It presents a clear and present danger to free society for reasons that need no elaboration. COVID-19 presents a heightened risk for incarcerated defendants like Mr. Hernandez with respiratory ailments such as asthma."

The rapper showed no symptoms of coronavirus infection Thursday, according to his lawyer.

"At some point, I'm guessing, yes," he'll be tested, Lazzaro said. "When it becomes readily available."

Hernandez last year flipped on members of the Nine Trey Gangsta Bloods, a gang founded by prisoners on Rikers Island, the notorious New York City jail.

His testimony helped convict gang leaders Anthony "Harv" Ellison and Aljermiah "Nuke" Mack in October of racketeering conspiracy connected to their alleged gang activity.

Download the NBC News app for full coverage and alerts about the coronavirus outbreak

In September, Hernandez told a court that his role had been to "just keep making hits and be the financial support for the gang ... so they could buy guns and stuff like that."

Engelmayer wrote that he doesn'ot believe Hernandez will be a threat to neighbors: "For reasons including those set out at length at Mr. Hernandez's sentencing, the Court is, further, persuaded that Mr. Hernandez — having been prosecuted, pled guilty, and publicly cooperated against members of the gang, the Nine Trey Gangsta Bloods, in concert with whom his violent acts were committed — no longer will present a meaningful danger to the community if at liberty."