Midland police said the active shooter situation ended hours after the gunfire erupted in one part of the city before ending up near a veterinary hospital.
Police did not immediately say how the suspect died. Midland Mayor Lori Blong said authorities used robot and drone footage to confirm that the shooter was dead.
Andrea Mendias said she heard what sounded like a small explosion at the closed veterinary clinic next to the body shop where she works and saw a number of heavily armed police officers rush into the parking lot. Some appeared to go inside the building.
Mendias said she earlier heard what sounded like at least 40 gunshots.
Video from Mendias showed officers pouring out of the back of an armored police vehicle and police deploying robots into the area.
Midland Memorial Hospital said four people underwent surgery and that three had been treated and released. Two others were in stable condition, the hospital said.