Statement from Meek Mill’s attorney Joe Tacopina:

“We are thrilled that the Pennsylvania Supreme Court has directed Judge Brinkley to immediately issue an order releasing Meek on bail. As we have said all along, Meek was unjustly convicted and should not have spent a single day in jail. We are also pleased that the Pennsylvania Supreme Court has noted that Judge Brinkley may opt to remove herself from presiding over any further proceedings in Meek’s case in the interests of justice. 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.”

Why was Meek Mill in jail?

Mill was sentenced in November to two to four years in prison for violating probation on a nearly decade-old gun and drug case.

Judge Genece Brinkley, who sentenced Mill for the probation violation, said he had wasted several chances to clean up his act after a 2009 gun and drug case. The sentence came against the recommendation of the prosecutor, who said Mill had matured since his original crime. Brinkley said the prosecutor did not know the case as well as she did and that Mill just “does what he wants.” Demonstrators took to the streets at the time in protest.

Mill was arrested twice — once in St. Louis for an alleged altercation in the airport and another time for alleged reckless driving in New York City involving a dirt bike.

Kevin Hart’s support for Meek Mill

Earlier Tuesday, fellow Philadelphian and comedian Kevin Hart was at the jail to visit Mill, CBS Philadelphia reports.

“The frustration for me is, why is he still there? I still don’t understand why he’s still in jail after so much has been pointed out,” Hart told reporters after his visit with Mill.

“I think the good with the situation is that he now has a platform. And I think coming out, he will be able to use that platform to really shine a light on how corrupt this system is and hopefully also keep this younger generation from going through this. And also, a lot of people that are incarcerated now that are doing unnecessary time.”

Hart said his relationship with Mill is strong and that he views the rapper as innocent.

“When you know that you’re innocent, it’s tough to sit through something that you know that you didn’t do,” Hart said.

Jay-Z’s support for Meek Mill

Jay-Z wrote an op-ed in the New York Times in November and called the rapper’s sentence “just one example of how our criminal justice system entraps and harasses hundreds of thousands of black people every day.”

Jay-Z wrote that Mill has been “stalked by a system that considers the slightest infraction a justification for locking him back inside” and said that when he was growing up in Brooklyn in the 1970s and 1980s, he saw that probation became a “landmine” for many. He pointed out that a “random misstep” could bring consequences greater than the crime.

“A person on probation can end up in jail over a technical violation like missing a curfew,” wrote Jay-Z. He pointed out, “As of 2015, one-third of the 4.65 million Americans who were on some form of parole or probation were black. Black people are sent to prison for probation and parole violations at much higher rates than white people.”

On Nov. 7, Jay-Z stopped his concert in Dallas to say of Mill, “He caught a charge when he was, like, 19. He’s 30 now, he’s been on probation for 11 years. F***ing 11 years. Judge gave him two to four years because he got arrested for being on a bike and popping a f***ing wheelie.”

CBS News’ Gisela Perez and Cassandra Gauthier contributed to this report.