A Palmer police officer was grazed in a shooting during a traffic stop on Interstate 45 in Ellis County on Saturday afternoon, according to the sheriff's department.

At approximately 3:50 p.m. a Palmer Police Officer stopped a Ford Mustang on the northbound shoulder of Interstate 45 in Palmer for a traffic violation.

When the Palmer Police Officer approached and identified the occupants, he determined that one of the occupants had an outstanding warrant for aggravated sexual assault from Collin County.

The officer then attempted to take that individual into custody, but the person resisted and fled on foot.

A taser was then used in an attempt to stop the individual but was unsuccessful and the individual attempted to take the officer’s sidearm. The weapon then discharged.

Afterwards the suspect was then taken into custody with the help of members of the public.

The officer sustained non-life-threatening injuries during the encounter.

The suspect also wasn't seriously injured and was taken to the Ellis County Jail for the outstanding warrant.

Officials say additional charges are pending.