Authorities say a multi-agency task force was watching an 18-wheeler loaded with drugs when men in several other vehicles approached the truck and opened fire.
Officers then engaged in a gun battle with the suspects. One suspect was injured and an informant who was inside the 18-wheeler was killed.
Authorities have arrested several of the men involved in the shooting.
The undercover deputy was taken to a local hospital with a leg wound. The shooting happened near Highway 249 and Hollister, north of Beltway 8.