An Alabama police officer was clubbed with his own gun during a traffic stop, authorities say.

The robbery detective stopped a maroon 2012 GMC Yukon last week in eastern Birmingham and told the suspect to stay in his vehicle. Instead, the suspect got out, jumped the officer, grabbed his gun and clubbed him with it.

Images posted to social media mock the wounded cop. One post read, “Pistol whipped his a** to sleep.”

The suspect, identified as 34-year-old Janard Cunningham, fled, but was arrested by police shortly thereafter. Cunningham has a long rap sheet, including a 2006 assault conviction.

The detective suffered lacerations to the head, but has since been released from the hospital.

Sgt. Heath Boackle, president of the Birmingham Fraternal Order of Police, was on “Fox and Friends” this morning to discuss the ordeal.

Boackle said that the media has been portraying law enforcement as criminals while making criminals look like the victims.

Watch the segment above.

Inmate Accused in Brutal Attack of 4 Jail Guards

Heroic K-9 Saves Officer From Brutal Roadside Ambush