A gunman who opened fire outside a Beaumont, Texas, courthouse Wednesday was disarmed and taken into custody with the help of hostages he had taken at a nearby business.

Bartholomew Granger, 41, opened fire from a vehicle at 11:21 a.m. in front of the Jefferson County Courthouse, wounding his daughter and her mother. The two were witnesses against him in his sexual assault case, reports ABC News.

Granger then shot two bystanders, killing one and wounding the second, before running down the street and entering a business, where he took hostages. The hostages disarmed Granger and opened the door for the SWAT team.