The attacker was killed at the scene by the first responding officer, police spokesman David Tilley said.
The officer was uninjured.
Seven people were found dead in the property in Plano, a suburb north of Dallas, at around 8pm on Sunday.
Two additional victims of the attack were taken to hospital. Their condition is unknown.
Mr Tilley said a shooting of this magnitude was unusual for Plano, especially in such a quiet neighbourhood
“We’re trying to put all the puzzle pieces together,” he said.
The victims are all believed to be adults. Neither they nor the suspect have been identified.
Police have yet to determine a motive for the attack.