LAS CRUCES, N.M. (AP) — Two New Mexico men say a Las Cruces police officer accidentally shot at them during a routine traffic stop and unlawfully held them for three hours.

A civil rights lawsuit filed in U.S. District Court last week claimed officer Jeremiah McDaniel “negligently fired his gun” at Keith Anderson and Carlos Cooper after pulling them over in August 2018.

According to court documents, the “bullet missed Anderson’s head by mere inches.”

The lawsuits says the men were then held unlawfully for three hours while investigators searched for the bullet. Court documents say police later told them to “go home.”

The men say they found a bullet hole just above the windshield on the passenger side the next day. Their attorneys said the men were victims of excessive force and that Las Cruces police violated their due process rights.

Las Cruces City Attorney Jennifer Vega-Brown did not immediately return an email.

Anderson and Cooper have both been diagnosed with post traumatic stress disorder, the lawsuit said.

The men are seeking an unspecified amount in damages.

Accidental shootings by law enforcement have happened in recent years at agencies small and large and at all levels — city, county, state and federal — across the U.S., an Associated Press investigation found. They’ve caused hundreds of injuries to officers, suspects and bystanders, and sometimes they’ve caused deaths.

The AP documented 1,422 unintentional discharges since 2012 at 258 agencies, and uncovered detailed reports on 426.