A man who provoked passenger panic by firing a gun inside a terminal at Houston’s largest airport was killed after being confronted by a law enforcement officer.

It was unclear if the man fatally shot himself or was killed by a Homeland Security agent who had confronted him, police said.

The man walked into the ticketing area in Terminal B at Bush Intercontinental Airport around 1.35pm local time and fired at least one shot into the air.

The agent confronted the man, telling him to drop his weapon, but the man refused, police said.

“The suspect then turned toward the special agent. The special agent, fearing for his safety and all the passengers in the terminal, discharged his weapon at the same time it appears the suspect may have shot himself,” a spokesman said.

The terminal was closed, but the rest of the airport was still running.

An airport spokeswoman said passengers who were due to leave from Terminal B were being rerouted to other terminals.