A gunman killed two people including a law enforcement officer on Monday after opening fire from inside a house near Texas A&M University in College Station, police said.
Four other people were injured in the incident, and police later shot and killed the gunman, they said.
The dead officer was identified as Brazos County Constable Brian Bachmann, said Scott McCollum, assistant chief of the police department at College Station.
McCollum said Bachmann was shot in front of the house, about two blocks from the university. He was pronounced dead at a nearby hospital.
McCollum did not identify the other victim, a male bystander. The gunman has not been identified.
A woman was shot and undergoing surgery, and a College Station police officer was in stable condition after being shot in the leg, McCollum said.
Two other officers were injured, he said. Their injuries were not life-threatening, according to the City of College Station.
"We had officers respond to a 'shots fired' call," McCollum said at a press conference. "Once the officers arrived, they began to trade fire. The officers defended themselves and called in additional officers."
College Station police officers shot and killed the gunman, said Jason James, a sergeant with the police department in Bryan, Texas.
Police said they do not know what sparked the violence but were confident only one shooter was involved.
The university issued a "code maroon" shortly after noon, warning students and employees that an "active shooter" was in the area west of campus and asking them to stay away.
"Our hearts and prayers go out to the victims and the families," said Lane Stephenson, director of news information services at Texas A&M University. He said the university was unaware if any of the victims were students.
The shooting comes amid national jitters over gun violence after a man opened fire in a crowded Colorado movie theater last month during a midnight showing of "The Dark Knight Rises," killing 12 people and wounded 58 others.
On August 5 a gunman opened fire at a Sikh temple in Wisconsin, killing six people before turning his gun on himself.