Pennsylvania’s highest court has ordered a judge to free rapper Meek Mill on bail while he appeals decade-old gun and drug convictions.

The Supreme Court directed a Philadelphia judge who had jailed Mill to immediately issue an order releasing him on unsecured bail.

This all comes after Judge Genece Brinkley denied Mill bail last Monday even though Philadelphia prosecutors said Mill’s nearly decade-old gun and drug convictions should be thrown out and that he should be granted a new trial.

“While the past five months have been a nightmare, the prayers, visits, calls, letters and rallies have helped me stay positive,” Mill tweeted Tuesday.

Mill’s lawyer, Joe Tacopina, believes Mill was “unjustly convicted” and shouldn’t have been in jail at all.

“Meek is excited to be reunited with his family, and we, along with Meek, intend to continue to shine the light on a justice system in need of reform to prevent any other citizen from being put through what Meek has endured,” Tacopina told TMZ.

Comedian Kevin Hart and Philadelphia 76ers co-owner Michael Rubin visited Mill in prison Tuesday and said on Instagram that they learned of the news of the court order shortly after leaving. Rubin said around 2:40 p.m. CT that he was on the way back to pick up Mill.

Contributing: Associated Press