PHILADELPHIA (AP) — Philadelphia-born rapper Meek Mill rang a replica Liberty Bell at center court of the Philadelphia 76ers’ first-round clinching playoff game Tuesday less than two hours after being released from prison while he appeals decade-old gun and drug convictions.

Following a five-month campaign by his supporters to get him out, the state Supreme Court on Tuesday directed a Philadelphia judge who had jailed him to immediately issue an order releasing him on unsecured bail.

Mill, whose real name is Robert Rihmeek Williams, was sentenced in November to two to four years behind bars for probation violations.

He was whisked from the State Correctional Institution in Chester by helicopter to nearby Philadelphia, just in time to ring the ceremonial bell before the start of Game 5 of the 76ers playoff series against the Miami Heat.

“I feel great,” Mill said before entering the Wells Fargo Center, where he greeted Sixers players in their locker room before the game the Sixers won 104-91 to advance to the second round of the playoffs.

“Welcome home Meek Mill,” the game announcer told the rapper, who wore a Joel Embiid jersey and sat courtside next to actor Kevin Hart, Sixers co-owner Michael Rubin, Philadelphia Eagles owner Jeffrey Lurie and Democratic Pennsylvania Gov. Tom Wolf.

A team of lawyers and public relations consultants had waged an all-out battle to get Mill freed, leveling fierce criticism at the judge as a stream of high-powered figures and celebrities visited him in jail in the weeks and days before the Supreme Court ruling.

Mill issued a statement saying the past months had been “a nightmare,” and thanked his many supporters and visitors, who included Rubin, New England Patriots owner Robert Kraft and Democratic Philadelphia Mayor Jim Kenney.

“Although I’m blessed to have the resources to fight this unjust situation, I understand that many people of color across the country don’t have that luxury and I plan to use my platform to shine a light on those issues,” Mill said.

He said he would now focus his attention on getting his convictions overturned, and that he looks forward to resuming his music career.

Earlier this month, in a major victory for Mill, prosecutors said they agreed with his lawyers that he should get a new trial because of questions raised about the arresting officer. The now-retired officer was among a list of police officers the prosecutor’s office has sought to keep off the witness stand in cases across the city because of credibility questions.

A spokesman for District Attorney Larry Krasner said late Tuesday that the Supreme Court’s decision on Meek Mill’s release was consistent with the position taken by their office.

The DA’s office has not said whether they would seek to retry him if the old convictions are thrown out. But it noted that just last week, prosecutors agreed not to further prosecute three defendants whose cases were tossed because of doubts about the credibility of the arresting narcotics agent, the same officer who had arrested Mill.

Mill’s attorney, Joe Tacopina, thanked the high court.

“Meek was unjustly convicted and should not have spent a single day in jail,” Tacopina said.

In an opinion earlier this month, Judge Genece Brinkley, who sent Mill to prison for the probation violations, strongly defended herself against accusations by the defense she was waging a vendetta against the rapper. She said the court “has impartially and without prejudice presided over numerous proceedings in this matter since 2008.”

The Supreme Court denied a defense request to move the case to another judge, but said the presiding judge could opt to remove herself.

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.