The Pennsylvania Supreme Court has ordered the immediate release of rapper Meek Mill.

TMZ reported that the 30-year-old, whose birth name is Robert Rihmeek Williams, was denied bail last week by Judge Genece Brinkley. Brinkley had been criticized for having what some considered a bias against Meek.

>> Read more trending news

In November, Meek was sentenced to two to four years in prison after violating probation for a drug and weapons case when he was 21.

The Associated Press reported that Meek will be on bail while he appeals the gun and drug convictions.

Related: Meek Mill sentenced to at least 2 years in prison for probation violation

Activists and celebrities, including JAY-Z, T.I. and Kevin Hart, have shown support for Meek. At the time of the sentencing, JAY-Z said Brinkley's sentence was "unjust and heavy handed." Hart visited Meek in prison earlier Tuesday with 76ers co-owner Michael Rubin.

Related: ‘Welcome home’: Meek Mill attends Philadelphia 76ers game after prison release

“We are thrilled that the Pennsylvania Supreme Court has directed Judge Brinkley to immediately issue an order releasing Meek on bail,” Meek’s lawyer, Joe Tacopina, said in a statement. “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.”

Related: JAY-Z, T.I., and others slam Meek Mill sentence as ‘unjust and heavy-handed’

Meek himself issued a statement that was posted on his Twitter page. He thanked his supporters and advocates while voicing plans to bring attention to people of color in prison and move on with his career.

"I'd like to thank God, my family, and all my public advocates for their love, support and encouragement during this difficult time," the statement said. "While the past five months have been a nightmare, the prayers, visits, calls, letters and rallies have helped me stay positive.

“To the Philly District Attorney’s office, I’m grateful for your commitment to justice. 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. In the meantime, I plan to work closely with my legal team to overturn this unwarranted conviction and look forward to reuniting with my family and resuming my music career.”