Rapper Meek Mill, whose real name is Robert Williams, was sentenced to two to four years in prison in Pennsylvania on Monday for violating probation, reports said.

Mill appeared before a Philadelphia judge, Genece Brinkley, 61, in connection with the violation of probation twice in a 2008 drug dealing and gun possession case.

On hearing the sentence from Common Pleas Court judge, the 30-year-old and other supporters present at the hearing appeared to be stunned, according to Philly.com.

Brinkley cited the reasons behind her decision which were a failed drug test and Mill's failure to comply with a court order restricting his travel. The judge confessed that she had been trying to help the rapper for about a decade but Mill appears to do what he wants to do, reports said.

"I gave you break after break, and you basically just thumbed your nose at this court," Brinkley told Mill.

The judge said the musician would serve his sentence in state prison. After two years, he would be eligible for state parole. "Then I’ll be done with you," Brinkley added, according to Philly.com.

Meanwhile, Mill reportedly addressed Brinkley for around 40 minutes, emphasizing on the fact that violations were mistakes. "I’m human. I’m not perfect," he said. "I’m asking for mercy. You gave me the ladder to do what I have to do to prevail in my struggle. I made it this far, I can’t really go back and start over."

However, Mill's plea did not make the judge change her decision and she ordered him to be taken into custody.

Mill's fans shared their reactions on Twitter with some saying that the artist would come out stronger from the jail and some demanding his release.

One user tweeted: "Meek Mill is one of my favorite rappers because he spits the truth in the music he makes this s***s for two years won't be able to listen to him make that motivational music #FreeMeek"

Another user tweeted: "Prayers go out to @MeekMill - America's justice system sucks."

Mill was born in South Philadelphia and grew up around North Philly. His father was murdered when he was just five-years-old. Mill's music has elements of his experiences growing up in a poor, single-parent home. His career kick-started after his 2009 release from prison.

Mill's third album, "Wins and Losses" was No. 3 on Billboard's albums chart after it released July 21. His second album, "Dreams Worth More Than Money" was released on June 29, 2015, and it entered music charts at No. 1. Mill was also dated the singer-songwriter Nicki Minaj, which ended this year.

In October, he pleaded guilty in Manhattan to reckless driving charges after he was arrested for carrying out stunts on a dirt bike on city streets. He also posted a video of his stunts online, Philly.com reported.

Prior to that, he was also arrested in March for a fight in an airport; however those charges were dropped after he agreed to perform community service for the Veterans Association in Philadelphia.