Lamarr T. Mayfield pleaded guilty Monday in Boone County Circuit Court in the April 2012 murder of 17-year-old Bryan Rankin Jr.
Police say Rankin and another teen argued before the shooting.
Rankin and his brother were trying to leave when someone shattered a window in their car and then shot Rankin.
Mayfield, who was 15 at the time of the shooting, was charged as an adult.
After pleading guilty, Rankin was sentenced to 17 years each for second-degree murder and armed criminal action.