Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A police officer was killed and two others were injured in what authorities described as an "ambush" in San Marcos, Texas, officials said.

The shooting took place after officers responded to a 6:05 p.m. domestic disturbance call at an apartment complex, the San Marcos Police Department said in a statement. "During the course of their response, the suspect ambushed the officers with a rifle," it said.

A suspect apparently died for a self-inflicted gunshot, police said.

Charley Wilkinson, the Executive Director of Combined Law Enforcement Associations of Texas, said in a tweet that one of the injured officers was in critical condition. Both underwent surgery at a hospital, San Marcos police said.

San Marcos is between Austin and San Antonio.

UPDATE: Officer dead, two others injured after an active shooter situation in San Marcos, a city council member confirms to KXAN https://t.co/qDrhq97bkb — KXAN News (@KXAN_News) April 19, 2020

The city of San Marcos tweeted at 7:13 p.m. that residents in the area of the shooting should shelter in place. Thirty minutes later, the city said the area was secure.

Texas Gov. Greg Abbott said in a statement that the violence "is a somber reminder of the service and sacrifice our brave men and women in law enforcement make everyday to keep us safe."