(CNN) -- A man was shot and killed Thursday in a pre-screening area at Bush Intercontinental Airport in Houston, authorities said.
Houston Police Department spokesman Kese Smith told reporters that the man had just come through the doors in Terminal B when he fired at least one shot into the ceiling.
A Homeland Security Investigations agent was working in an office near the scene, came out and told the man to drop his weapon. The agent fired once at the suspect, who appeared to try to shoot himself at the same time.
An autopsy will determine whose bullet killed the man, who has not been identified, police said.
CNN affiliate KHOU reported the man walked into the terminal with a military-style, semiautomatic rifle and fired two shots into the ceiling.
The station interviewed a woman who works at a McDonald's in the terminal.
"As soon as he walked in, he just automatically started shooting quickly," said the employee, who said her name is Kendra. "And we hear two shots and we just automatically started running. We ran all the way to the back."
Rebecca McCormick, a CNN iReporter, was just getting off a plane when she saw people running towards her and shouting and screaming. She talked to Grant Huff of Charleston, South Carolina, who heard the shots.
"After the first two gunshots everyone stopped and kinda looked" thinking it might be a fallen chair or something like that, he said. "A TSA gentleman came out and said, 'Everybody get down.' We heard two more gunshots."
Everyone took off running, Huff said.
As iReporter McCormick recounted her interview with Huff, an airport announcement could be heard asking people to stay where they were because everyone had to be interviewed before they could leave.
The Federal Aviation Administration said on its website that many flights bound for Bush were being held at their departure airports.
CNN's Ed Lavandera contributed to this report.