After a long legal battle—involving a controversial case judge, an arresting officer investigated for corruption, several requests for new trials and bail releases, and other issues—Meek Mill will be released from prison in an hour, according to TMZ.

The Supreme Court of Pennsylvania overruled Judge Genece Brinkley who, throughout the case, had faced frequent claims of bias and requests to recuse herself. Most recently, she denied Meek’s latest bail request and then delayed the hearing for 60 days.

The site also reports that, according to the official order from the Pennsylvania’s Supreme Court, “the justices cited the alleged corrupt police officer who served as a ‘critical witness’ in Meek’s original gun and drugs case as a crucial point in their decision to order his bail. It also said prosecutors were not opposed to him being released, and sided with them.”

Meek took to Instagram upon his release:

“I’d like to thank God, my family, my friends, my attorneys, my team at Roc Nation including JAY-Z, Desiree Perez, my good friend Michael Rubin, my fans, The Pennsylvania Supreme Court and all my public advocates for their love, support and encouragement during this difficult time.”

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

“To the Philadelphia District Attorney’s office, I’m grateful for your commitment to justice – not only for my case, but for others that have been wrongfully jailed due to police misconduct. 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. 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.”

The rapper will reportedly attend a Philadelphia 76ers game tonight, according to Page Six. The site reports that team o-owner Michael Rubin is personally picking Meek up from Chester State Prison.