Meek Mill’s attorneys and prosecutors have worked out a deal that will see all the charges against him from a long-running 2007 case dropped. Mill pleaded guilty Tuesday morning to a misdemeanor gun charge and all of the other charges were dropped, according to CBS News. A judge accepted Mill’s plea.

“I know this has been a long road for you and hopefully this will be the end of it,” the judge, Leon Tucker, told Mill (real name: Robert Rihmeek Williams).

The rapper thanked a group of supporters outside Philadelphia’s Criminal Justice Center after the hearing.

“Free Meek helped me get to this position,” Mill said, referring to the movement that has supported him for many years. “I’m not on probation no more. Thank you, I appreciate that a lot. And I just wanted to come up here myself and thank all the supporters because I know y’all probably got family members in jail or people going through the same thing as me and I will continue to do what I do with the reform movement and help the people who helped me.”

The rapper was incarcerated for around two years over a drug and gun conviction that was overturned in July because of credibility concerns about the arresting officer. That officer, Reginald Graham, is accused of having stolen money on duty and lying about it; he has denied the allegations. Testimony from the 2008 trial shows Mill acknowledged having a gun but denied pointing it at police or selling drugs.

Mill has become an activist for reform of the criminal justice system since he was surprisingly sent back to prison in 2017 for technical violations. He spent five months in prison, amid outcry from thousands of fans and vocal support from Jay-Z and Philadelphia 76ers owner Michael Rubin. After Mill’s dramatic April 2018 release from prison, Rubin flew him by helicopter directly to a 76ers game, where he had courtside seats.

Last month, just hours before the Pennsylvania Superior Court threw out his conviction, Mill and Jay-Z announced they are partnering to bring Meek’s Dream Chasers label into the Roc Nation fold.