Controversial rapper Tekashi69 was sentenced on Wednesday to two years in prison, after a federal judge praised his "game-changing" cooperation against his former gang, Nine Trey Gangsta Bloods.

The 23-year-old Bushwick-born performer, whose real name is Daniel Hernandez, faced decades in prison on racketeering and gun charges stemming from his involvement with the NYC-based street gang.

As part of a plea deal with the government, he agreed to testify against fellow gang members, who were ultimately convicted on kidnapping, maiming, and assault charges. The testimony, which implicated Cardi B and the Bronx-based rapper Jim Jones as members of the Bloods, sparked ridicule across the music industry. Snoop Dogg described him as a "snitch" and “rat."

In their sentencing memo, prosecutors urged the judge to consider Tekashi's "critical insight" into the gang.

"Your cooperation was impressive. It was game-changing. It was complete and it was brave," said U.S. District Judge Paul Engelmayer before announcing the decision, according to NBC News.

The rapper, who had been on probation for a sex crime with a minor when arrested in 2018, also addressed the court room on Wednesday, apologizing to his younger fans for getting swept up in the gang culture.

"I failed these people," he said, according to an Inner City Press reporter. "They believed in Daniel Hernandez. I was too busy making the negative image in my 69 persona.

The two-year sentence will include the 13 months Tekashi has already served. He will also receive five years of supervised release, 300 hours of community service, and a $35,000 fine.

He has reportedly indicated that he will reject a witness protection program, and instead plans on releasing new music and performing.