The Philadelphia-based rapper Meek Mill was released from a city jail Tuesday afternoon after serving nearly five months behind bars for failing to comply with a probation sentence that conflicted with his tour schedule.

Common Pleas Court Judge Genece E. Brinkley granted early parole to the 27-year-old, whose legal name is Robert Williams, on the condition that he complete a plan of community service and treatment before he resumes concerts, said Tasha Jamerson, spokeswoman for District Attorney Seth Williams.

"Until the defendant completes those components, only then will her honor entertain a motion . . . for the defendant to be able to travel," Jamerson said. "This means that the defendant cannot book entertainment gigs, etc."

Mill completed three programs - drug treatment, anger management, and parenting - while in custody at a prison facility in North Philadelphia, officials said Tuesday night.

Mill was transferred to Curran-Fromhold Correctional Facility for his release, which occurred around 4:15 p.m., said city prisons spokeswoman Shawn Hawes.

Not long after that, he took to Twitter, announcing "My hood right nowwwww!" and posting a short video clip of people dancing around a Philadelphia police car with its lights and sirens going. By 9:30, that message had been retweeted 13,000 times.

On July 11, Brinkley sentenced Mill to three to six months for violating his probation stemming from a 2009 conviction on gun and drug charges.

The prosecutor had asked the judge to sentence Mill to five to 10 years, citing a litany of alleged probation violations.

But Mill said he needed to work, as not only does his career support him, it also supports his mother, sister, son, and friends. His monthly expenses, he said, are from $80,000 to $90,000.

Furthermore, he complained that his schedule was already "booked up till December."

Brinkley interjected: "I don't want to hear it; I don't care about it."