Agents with the United States Border Patrol shot and killed a man who had shot and wounded an officer with the Las Cruces Police Department on Monday.

According to the El Paso Times, the officer shined a light on the man—who was on foot—from his patrol vehicle and the man opened fire, striking the vehicle at least two times.

The officer suffered non-life-threatening injuries, and drove himself to a nearby hospital.

Multiple agencies responded in the search for the gunman, who was found near a hardware store.

The man refused to comply with commands and again fired at least one shot at the officers involved in the search

Officers returned fire, fatally striking the gunman.