A tearful Sheriff Michael Tregre said the episode started when a gunman opened fire for unknown reasons on a deputy working an off-duty traffic detail along a highway. That deputy was wounded. Tregre said someone called deputies with a description of a car fleeing the scene, and officers tracked it to a trailer park.

When officers found the car, they handcuffed a suspect outside a trailer, then knocked on its door. Tregre said someone with a dog answered.

‘‘Another person exited that trailer with an assault weapon and ambushed my two officers,’’ Tregre said. Two deputies were killed and a third was wounded. Two suspects were wounded in the subsequent shootout, Tregre said.

The dead deputies were identified as Brandon Nielsen, 34, and Jeremy Triche, 27. The wounded officers were Jason Triche, 30, and Michael Boyington, 33. They were being treated at area hospitals but the extent of their injuries was not known. The Triches are not believed to be related.