A Florida sheriff's office on Friday released a video of a traffic stop that became violent when the driver punched a deputy before firing shots at the officer.

Indian River County Sheriff's Deputy Christopher Lester pulled over Andrew Coffee, 52, Thursday night for not having a tag on his moped, according to the sheriff's office.

Deputy Chris Lester. Indian River County Sheriff's Office

Lester's dashcam camera captured the deputy requesting Coffee, who has a long, violent criminal record, to put his hand on the hood of his patrol car multiple times after warning him: "Don't go reaching for anything." In the video, Coffee briefly puts his hands on the hood, but then removes them and repeatedly asks, "what's the problem."

Without warning, Coffee socks Lester in the face.

The suspect then "drew a revolver from his waistband and fired," according to a statement from the Indian River County Sheriff's Office.

Suspect, Andrew Coffee. Indian River County Sheriff's Office

Lester was shot in the leg, but returned fire and struck Coffee twice, the statement said. Lester is hospitalized in good condition, while Coffee is undergoing surgery, according to the statement.

Coffee was released from prison last year after serving time for charges in 1993 of attempted first-degree murder with a firearm, according to NBC affiliate WPTV. His rap sheet includes 11 felony arrests and four felony convictions, the station reported.

Coffee was arrested earlier this month on drug charges, and is due to appear in court on Jan. 3, according to jail records.