Three law enforcement officers in southern New Mexico were injured this morning during a shootout that involved U.S. Border Patrol agents stationed outside El Paso, Texas.

The Las Cruces Police Department said an officer was on patrol on the city's Lohman Avenue around 2:30 a.m. MDT when he encountered a suspicious person. The officer shined a vehicle light on the pedestrian, and the man opened fire.

The officer was struck and did not chase the suspect but drove himself to a local hospital for medical help.

Police said the suspected shooter, whose name has not been released, then unsuccessfully attempted to carjack a nearby delivery driver.

Border Patrol agents from the El Paso region's Las Cruces station and the Dona Ana County Sheriff's Office were called in to help respond around 4 a.m.

"Multiple agencies responded to the scene and located the suspect near The Home Depot. Officers attempted to take the suspect into custody and gave multiple commands, but he was non-compliant. Officers fired non-lethal munitions but they, too, were largely ineffective. It’s believed the suspect fired at least one round toward officers before they responded with multiple rounds," Las Cruces police said in a statement. Customs and Border Protection confirmed in a statement that agents "returned fire with their service issued weapon, striking the subject."

The shooter was declared dead at the scene.

A second Las Cruces police officer and a Dona Ana County sheriff's deputy also sustained non-life-threatening injuries during the shootout.

Law enforcement has not shared whether a federal agent or local officer was responsible for killing the man or whether any injured officer was struck by a fellow officer or agent's bullet.

Las Cruces police are leading the investigation into the incident. CBP's Office of Professional Responsibility and the Department of Homeland Security inspector general's office will also look into agents' use of force, which is agency protocol.