French Montana's rap protege Lil Durk has been sentenced to probation after pleading guilty to a gun possession charge.

The rising hip-hop star, real name Durk Banks, was arrested in his native Chicago, Illinois in April, 2013 after police caught him throwing a loaded weapon into the back of his car.

Prosecutors suggested Durk be punished with a year behind bars, but Cook County Judge Joseph Kazmierski, Jr. decided instead to order him to serve 18 months on probation.

A lawyer for Banks, who previously spent time in jail for a 2011 weapons charge, told the court his client had been trying to make amends for his bad behaviour by spending more than 150 hours volunteering for anti-violence programme Cure Violence at the University of Illinois.

The judge sentenced him to complete an additional 50 hours of community service.

Banks has since vowed to stay on the right side of the law and not return to court.

Speaking after his hearing, he told The Chicago Tribune newspaper, "The key word is I'll be staying out of trouble."