LEXINGTON, Ill. (WMBD) — A man who allegedly shot at a Lexington police officer, prompting him to fire back, has been charged with attempted murder.

Ryan Aeron Stanley Hurst, 18, is facing charges of attempted murder, aggravated discharge of a firearm at a peace officer and aggravated assault at a police officer, according to McLean County Circuit Court records.

The Illinois State Police, which is investigating the shooting as required by law, said officers responded to a call about a vehicle that was involved in an armed robbery that occurred in Texas.

The vehicle was spotted on Interstate 74 in Champaign County and followed to McLean County where it got off at an exit in Lexington at a Casey’s gas station.

Officers tracked the vehicle to McLean County where Joseph Martin Hernandez exited the vehicle and entered a Casey’s Gas station in Lexington, thats when officers converged to take him and another person into custody.

Hurst, who was in the vehicle, allegedly pointed a gun at officers who were able to shoot first, striking him. Hurst was taken to an area hospital for treatment, according to the state police.

The other man, the state police said, was not injured and was taken into custody for further investigation. ​

This incident is being investigated by the Illinois State Police.

Hurst is scheduled to return to court for his arraignment on March 14. If convicted, he faces decades behind bars. A judge Monday ordered he be held in custody pending the outcome of his case.