As expected, rapper Tekashi 6ix9ine received a relatively lenient sentence of two years in prison on racketeering, gun and drug charges today after cooperating with police and testifying against several former associates in the Nine Trey gang, according to CNN. He was also sentenced to five years supervised release plus 300 hours of community service.

Attorney Lance Lazzaro had asked the court to sentence him to time served owing to his minimal criminal history and his “extraordinary assistance and cooperation with the government,” according to a court filing. Prosecutors also requested that he receive a reduced sentence on the basis of his testimony and information, although they also argued that he and gang members “wreaked havoc” in three 2018 New York City shootings: one in Times Square, another at the Barclay’s Center arena, and a third at the W Hotel in Times Square.

The sentence wraps a convoluted and confusing saga involving the rapper (real name: Daniel Hernandez) and the Nine Trey gang, of which he was a member, although he later claimed he exaggerated the association in an effort to increase his street cred, and he appeared with guns and stacks of cash in his videos. That association later proved problematic on several levels when gang members allegedly kidnapped and robbed him last year.

“Mr. Hernandez is a rap artist who foolishly joined the Nine Trey Gansta Bloods (hereinafter “Nine Trey”) in an attempt to promote a gangster persona which would help him sell his music and advance his career,” Lazzaro wrote.

In January the rapper made a plea deal — in which he admitted that he’d hired someone to shoot rival rapper Chief Keef, and to selling a kilo of heroin in 2017 — that saw him cooperating with federal law-enforcement officers; the agreement was initially sealed to give prosecutors time to charge and arrest members of the Nine Trey gang.

The rapper said he had joined the gang in 2017. “On or about June 2, 2018, in furtherance of Nine Trey, of the Nine Trey enterprise, I paid a person to shoot at a rival member of Nine Trey to scare him. The shooting took place in Manhattan,” he told a judge.

“I did this to maintain or increase my own standing in Nine Trey,” he continued. “In furtherance of this shooting, I knew that a member of Nine Trey discharged a gun.”

He also said that, “On or about March 20, 2018, I helped members of Nine Trey attempt to kill a rival gang member,” adding that he participated in a robbery at gunpoint in April and sold a kilo of heroin in 2017.

In total, Hernandez pleaded guilty to nine federal felonies including racketeering conspiracy, firearms charges, narcotics trafficking, and violent crimes in aid of racketeering.

“I now know that I am remorseful for what happened because I was blessed with the gift of an opportunity that most people dream of but I squandered it by getting involved with the wrong people and misrepresenting myself when I should have been true to myself and my fans,” Hernandez wrote.

“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.”