Rapper Meek Mill pleaded guilty to a misdemeanor gun charge Tuesday in a deal that resolves a 2007 arrest that has kept him on probation or in prison for most of his adult life.

The negotiated plea comes after an appeals court threw out his conviction last month over doubts about the arresting officer’s credibility. The 32-year-old rapper, born Robert Williams, is now free of a criminal justice system he hopes to reform.

“I know this has been a long road for you and hopefully this will be the end of it,” Judge Leon Tucker told him.

MEEK MILL CONVICTION OVERTURNED BY PENNSYLVANIA APPEALS COURT

Williams has called the 12-year ordeal “mentally and emotionally challenging,” but said millions of people face the same issues.

“I know you probably got family members in jail, people going through the same thing as me,” Williams told a small crowd as he left the courthouse. “I will continue to do what I do with the reform movement and help the people that helped me.”

MEEK MILL SEEKS TO GET 2007 CASE DROPPED

FILE - In this Aug. 6, 2019 file photo, Rapper Meek Mill departs from the criminal justice center in Philadelphia after a status hearing. Mill is due in court Tuesday to learn if Philadelphia prosecutors will drop a 2007 case that’s kept him under court supervision for more than a decade. (AP Photo/Matt Rourke, File)

In this Aug. 6, 2019 file photo, Rapper Meek Mill departs from the criminal justice center in Philadelphia after a status hearing. Mill is due in court Tuesday to learn if Philadelphia prosecutors will drop a 2007 case that’s kept him under court supervision for more than a decade. (AP)

MEEK MILL RELEASED FROM PRISON AFTER HIGH COURT ORDER

He took up the cause after clashing repeatedly with the trial judge who ordered 10 years of probation and sent him back to prison in 2017 for technical violations. He spent five months locked up before the Pennsylvania Superior Court granted him bail and removed her from the case.

District Attorney Larry Krasner’s office supported Williams’ appeal and said it could not call the former officer to testify after the department found he’d stolen money on duty and lied about it. The officer, Reginald Graham, has denied the allegations.

Still, Krasner could not ignore the fact that Williams acknowledged having a gun, though he denied pointing it at police or selling drugs.

Krasner has overseen an office that has backed more than a dozen exonerations but said this is not that type of case. It is one in which Williams was guilty of a gun crime, but was excessively punished, Krasner said.

“Just as Mr. Williams has evolved in the last 10-plus years, the criminal justice system also needs to evolve,” he said.

DRAKE, MEEK MILL END FEUD AT BOSTON CONCERT

In this Tuesday, July 23, 2019 photo, Meek Mill makes an announcement of the launch of Dream Chasers record label in joint venture with Roc Nation, at the Roc Nation headquarters in New York.   A Pennsylvania appeals court has thrown out rapper Meek Mill's decade-old conviction in a drug and gun case. The unanimous three-judge opinion Wednesday grants the rapper born Robert Williams a new trial because of new evidence of alleged police corruption. (Photo by Greg Allen/Invision/AP)

In this Tuesday, July 23, 2019 photo, Meek Mill makes an announcement of the launch of Dream Chasers record label in joint venture with Roc Nation, at the Roc Nation headquarters in New York. A Pennsylvania appeals court has thrown out rapper Meek Mill's decade-old conviction in a drug and gun case. The unanimous three-judge opinion Wednesday grants the rapper born Robert Williams a new trial because of new evidence of alleged police corruption. (AP)

JAY-Z ADVISED MEEK MILL TO SKIP OUT ON TRUMP WHITE HOUSE INVITATION

Kahsim Buey, 23, listened to his music growing up in North Philadelphia and listened in court Tuesday as he entered his plea. Buey, who spent time in a youth detention center at 14, recently became the first in his family to graduate college and hopes to become a lawyer.

He believes that judges often believe police over defendants.

“Just like the Meek situation. His voice was little at the beginning, but now his voice is big because of the person he is,” Buey said. “I’m very happy for Meek today.”

Buey, a law intern, said he was pulled over by police this month for allegedly running a red light on his bike. The officer searched his drawstring bag for a gun, he said.

“They know our voice is little, so they mess with us,” he said. “That’s why I want to become a lawyer.”

In 2015, a federal jury rejected a lawsuit Williams filed against a Philadelphia police officer over what he called a racially motivated, 10-hour traffic stop that led him to miss the launch party for his 2012 debut album, “Dreams & Nightmares.”

His follow-up albums include the chart-topping “Dreams Worth More Than Money” and last year’s “Championships,” which includes performances from Jay-Z, his mentor, and former girlfriend Nicki Minaj.

CLICK HERE TO GET THE FOX NEWS APP

On July 24, just hours before the Pennsylvania Superior Court threw out his conviction, Meek Mill and Jay-Z announced they were launching a new label and starting a $50 million criminal justice reform group.