A federal judge sentenced the rapper known as Tekashi 6ix9ine to two years behind bars on Wednesday, but also praised the musician for helping prosecutors put away two violent New York street gang leaders.

The 23-year-old, whose legal name is Daniel Hernandez, will also be subject to five years of supervised release, according to the sentence handed down by U.S. District Court Judge Paul Engelmayer in New York.

With 13 months already served, the rapper could be set free in 11 months.

Tekashi 6ix9ine's pleaded guilty earlier this year to charges connecting him to the Nine Trey Gangsta Bloods, a gang founded by prisoners on Rikers Island, a notorious New York City jail.

In sentencing Tekashi 6ix9ine, Engelmayer quoted Bruce Springsteen's song "Murder Incorporated."

"Bruce Springsteen sang about 'Murder Incorporated,' you essentially joined Murder Incorporated," the judge said.

Tekashi 6ix9ine could have been sentenced to 47 years in prison, but prosecutors recommended a lesser sentence in exchange for his cooperation.

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

"Your cooperation was impressive. It was game-changing. It was complete and it was brave," Engelmayer said in announcing the more lenient sentence in Manhattan federal court.

Back in September, 6ix9ine 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."

Asked what he got in return, he said: "My career. I got the street credibility. The videos, the music, the protection — all of the above."

Tekashi 6ix9ine's deal with prosecutors has drawn fire from many in the rap community including icon Snoop Dogg, who label Hernandez a "snitch" in an Instagram post.

The rapper is a social media phenomenon with 14.2 million of followers on Instagram. His best-known songs are the multiplatinum hit, "Fefe," with Nicki Minaj, and "Stoopid," featuring the incarcerated rapper Bobby Shmurda.

He sports distinctive facial tattoos — including a large "69" on his forehead — which could make concealing his identity a challenge if he seeks protection for helping prosecutors.