A teenager who fatally shot a man at a Flagstaff recreation center has been sentenced to 17 years in prison.

The 15-year-old boy previously pleaded guilty to second-degree murder and one count of armed robbery.

Prosecutors said the teen killed 20-year-old Jacob Allen on March 3 after meeting him at the Hal Jensen Recreation Center for a marijuana sale.

Court documents show the boy attempted to rob Allen and pulled a gun on him before the pair exchanged gunfire.

The Arizona Daily Sun reported that Coconino County Attorney William Ring had recommended that the teen serve 18 years for murder and 10 ½ years for the armed robbery, with both sentences being served concurrently.

The teen was given credit for time served for the eight months he's been in custody.