EXCLUSIVE

2:29 PM PT -- Kevin's attorney, Herschel Rush, tells TMZ the rapper's charges carried a maximum of 10 years in prison so "we are very pleased with the result of 30 months."

Rapper Kevin Gates ﻿finally knows his fate in his gun case -- he's going to prison for 30 months.

The Cook County Sheriff's Office in Illinois says Kevin appeared in court Wednesday and pled guilty to his original charge of felony gun possession. Remember, the outstanding weapons-related warrant popped up the same day he completed his sentence in Florida for kicking a woman in the face at one of his shows.

The warrant was issued because Kevin failed to appear in court for the 2013 gun case.