PHILADELPHIA — Lawyers for Meek Mill are asking for him to be released from prison and for his probation to be terminated.

Judge Genece Brinkley sentenced the rapper last week to two to four years in prison for violating probation in a nearly decade-old gun and drug case.

She cited a failed drug test, failure to comply with a court order restricting his travel and two other unrelated arrests in ordering the prison time, saying, “You basically thumbed your nose at me.”

In an appeal filed Wednesday, his lawyers make a number of arguments, including that Meek Mill’s probation officer and a prosecutor with the district attorney’s office didn’t recommend a prison sentence as punishment.

They say the sentence was too harsh for his relatively minor offenses.

On Tuesday, they asked Brinkley to step down from the case in a motion that alleges Brinkley has gone beyond the bounds of a proper judicial role and has made the case inappropriately personal.

Among the examples cited was the judge suggesting Mill record a version of the Boyz II Men song “On Bended Knee” and specifically mention the judge in it. The lawyer says after Mill declined, the judge replied: “Suit yourself.”

Due to his celebrity, Mill has been put in protective custody at the state prison. The only housing units the prison has for such custody is in solitary confinement, where he spends 23 hours a day, seven days a week, according to the motion.

On Monday, former Philadelphia 76er Julius Erving and rapper Rick Ross were among hundreds of people gathered to protest Mill’s imprisonment at a rally near City Hall.

Billboards, buses and bus shelters with messages reading “Stand With Meek Mill” have popped up around the city after his sentence.