One police officer was killed and two others were injured in what the authorities described as an "ambush" in San Marcos, Texas, officials said.
The shooting occurred after police responded at 6:05 pm domestic disturbance call in an apartment complex, the San Marcos Police Department said in a statement. "During the course of his response, the suspect ambushed the police with a rifle," he said.
One suspect apparently died of a self-inflicted gunshot, police said.
Charley Wilkinson, executive director of the Texas Combined Law Enforcement Associations, said in a tweet that one of the injured officers was in critical condition. Both were operated on in a hospital, the San Marcos police said.
San Marcos is between Austin and San Antonio.
The city of San Marcos tweeted at 19:13 that residents in the shooting area should take shelter on the spot. Thirty minutes later, the city said the area was safe.
Texas Governor Greg Abbott said in a statement that violence "is a bleak reminder of service and sacrifices our brave law enforcement men and women who do it every day to keep us safe."