A federal judge has denied Tekashi 6ix9ine’s request to be freed from prison and put on home confinement over the rapper’s concerns that he is a target for Blood gang members.

Judge Paul Engelmayer ruled that it is “necessary in this case” for Tekashi to remain behind bars to “reflect the seriousness of his crimes,” TMZ reported.

Tekashi, 23, whose birth name is Daniel Hernandez, filed documents through his attorney saying he feared for his safety because he helped the government nab a few Nine Trey Gangster Bloods. Apparently members of the gang are also in the same prison facility with him.

READ MORE: Tekashi 6ix9ine, sullen and sorry in court, handed two year sentence on multiple charges

“As a result of Hernandez’s cooperation with the government against multiple gang members with the Bloods, Hernandez’s safety is still and will continue to be for the foreseeable future, seriously at risk,” according to court documents filed this month by Tekashi’s legal team. “Given the significant and ongoing threat to Hernandez’s safety as a result of his past and potential future cooperation, the government has filed papers which force Hernandez to remain incarcerated at a private jail in an effort to secure his safety. However, even at the private jail, Hernandez is still housed with various members of the Bloods.”

Engelmayer responded to the request by saying he realizes the situation isn’t ideal in terms of the lack of rehabilitative programs at the private jail that houses Tekashi compared with other prisons, but that if he allowed Tekashi to be released to home confinement, it would “eliminate the remaining prison component of his sentence in favor of lesser forms of confinement,” TMZ reported.

Tekashi, who previously claimed membership in the Nine Trey Bloods sect, received a two-year prison sentence along with five years of supervised release for cooperating with federal law enforcement. He must also pay a $35,000 fine and complete 300 hours of community service upon his release. Another component of his sentence allows the U.S. Attorney’s Office to reach out to Tekashi in the future for his help resolving other outstanding cases.

OPINION: Tekashi 6ix9ine is a five-part lesson in the problematic reality of modern day hip-hop

Prior to pleading guilty to nine counts, including racketeering, conspiracy and weapons offenses, the rapper orignally faced a 47-year mandatory minimum sentence and a maximum of life in prison.

He has already served 13 months of his sentence and could be released as early as July

Tekashi’s girlfriend seemed to question the fairness of the ruling in a message to the rapper, according to TMZ. “Sammy the Bull kills 19 people and gets 5 years. You kill no one and get 2 years. This s**t is so f****d up,” she reportedly wrote.

Dawn Florio, Tekashi’s lawyer, told TMZ that she’ll be appealing the decision.