Rapper Tekashi 6ix9ine has penned a grovelling letter to a judge apologizing for his crimes and begging for a 'second chance' as he faces life behind bars.

Officially known as Daniel Hernandez, the 23-year-old who is to be sentenced next Wednesday in New York for drugs and racketeering charges, told Judge Paul Engelmayer that he was 'becoming more and more overwhelmed' as the date approached.

Tekashi, who was charged along with five other 'Nine Trey' gangsters in November 2018, was mocked by the Hip-Hop community for turning 'snitch' and cooperating with prosecutors in a bid to earn himself a lighter sentence.

In the letter obtained by TMZ, Tekashi writes: 'I'm sorry to the victims who were affected by my actions, to my fans who look up to me and were misled, to my family who depends on me and to this courtroom for this mess that I contributed to.

'I'm truly sorry for the harm that I've caused. If given a second chance, I will not let this Court down and I will dedicate a portion of my life to helping others not make the same mistakes that I've made.'

Daniel Hernandez, 23, who is to be sentenced next Wednesday in New York, told Judge Paul Engelmayer that he was 'becoming more and more overwhelmed' as the date approached (pictured: at his arraignment in Manhattan Criminal Court on Wednesday, July 11, 2018)

Tekashi 6ix 9ine's letter to Judge Paul A. Engelmayer sitting at Thurgood Marshall US Courthouse in Foley Square, Manhattan. He says to the judge: 'I'm truly sorry for the harm that I've caused. If given a second chance, I will not let this Court down and I will dedicate a portion of my life to helping others not make the same mistakes that I've made.'

Tekashi was charged with his Nine Trey affiliates last year in an indictment outlining their alleged involvement in drug sales and two shootings in New York City.

Facing a string of charges including racketeering and firearms offenses, the rapper immediately flipped against the others and agreed to cooperate with prosecutors in hopes of earning himself a break at his own sentencing.

He pleaded guilty to nine federal charges including ones related to racketeering, conspiracy, firearms offences and drugs trafficking.

Under the plea deal he testified against two high-ranking members - Anthony 'Harv' Ellison and Aljermiah 'Nuke' Mack - who were both subsequently convicted.

Over three days on the witness stand last month, Tekashi unleashed a cache of damning details about the illegal acts he witnessed during his time with Nine Trey, a violent faction of the infamous Bloods.

He described how he used Nine Trey to increase his street credibility and bolster his career, in exchange for bankrolling the gang's operations through his music earnings.

The rapper was labeled a snitch on social media after reeling off the names of other stars he says were involved in the gang, including Cardi B (who denies any association with the gang) and Jim Jones.

Tekashi69 at arrives for arraignment on assault charges at Harris County Courthouse in Houston, Texas in August 2018

His testimony was so unreserved it prompted many to question how safe he would be on the outside, once whatever prison term he negotiated with the government is complete.

He is set to learn his fate on December 18. He faces up to 47 years in prison but apparently believes the sentence will be reduced to a matter of months, according to a Page Six source.

Tekashi already said he will not accept witness protection and plans to hire a personal security detail to protect him around-the-clock instead.

Whether or not he'll be able to afford private security is a different question.

The rapper's net worth is mysterious. Some say he is worth around $10million and others put his fortune significantly lower at around $1million.

In either case, his no-doubt mountainous legal bills will take a chunk out of whatever money he has, leaving a shrinking pot for round-the-clock protection.

As for who will want to make music with him now or endorse him, the prospects are bleak.

By accusing several fellow rappers of gang involvement during the trial, Tekashi became a pariah in the music industry as many fellow artists described him as a 'hungry' internet star who clung to fame without talent to back it up.

Tekashi was charged with his Nine Trey affiliates last year in an indictment outlining their alleged involvement in drug sales and two shootings in New York City

Known almost as much for his tattooed, rainbow-haired look as for his music, Brooklyn-born Tekashi was a social media phenomenon before becoming an ascendant name in hip-hop.

At the height of his popularity he had 15.5 million followers on Instagram. Following the trial, that number had dropped by over one million.

Tekashi's album Day69: Graduation Day was among the top-sellers on iTunes following its February 2018 release.

His biggest songs were the multiplatinum hit 'Fefe,' with Nicki Minaj, which peaked at number three on the pop charts, and 'Stoopid,' featuring the incarcerated rapper Bobby Shmurda.