A federal security agent has been killed and several other people wounded in a shooting at Los Angeles International Airport, officials say.
The Transportation Security Administration (TSA) said three of its staff had been injured, one fatally.
The suspect – named by the FBI as 23-year-old Los Angeles resident Paul Anthony Ciancia – was wounded by police and detained.
Hundreds of flights nationwide were affected by the incident.
LA Airport police chief Patrick Gannon told reporters a “lone shooter” came into Terminal 3 at 9:20 local time (16:20 GMT).
The suspect “pulled an assault rifle out of a bag and began to open fire in the terminal” inside the nation’s third largest airport, he said.
He then allegedly went to a security screening area and continued shooting.
“As you can imagine, a large amount of chaos took place in this entire incident,” Mr Gannon said.
It was the first time a TSA officer was killed in the line of duty, according to Los Angeles Mayor Eric Garcetti.
He said it was fortunate that the authorities had tackled the suspect because he had been armed with more than 100 rounds of ammunition.
A law enforcement official told the Associated Press Mr Ciancia was shot in the mouth and the leg by two airport police officers.
US media report that the alleged gunman approached potential victims asking if they worked for the TSA, and spared them if they said no.
Little is known about the suspect.
Mr Ciancia’s family in New Jersey told police on Friday they had received a text message from him saying he planned suicide, report US media.
“Their younger child got a text message from Paul [Ciancia] stating that there were some comments in there about his wellbeing and he wanted to possibly take his own life,” a New Jersey police chief, Allen Cummings, said.
Mr Cummings said he called Los Angeles police, who sent officers to Ciancia’s apartment in the city.
Two roommates of Mr Ciancia told Los Angeles police on Friday they had seen him on Thursday and appeared fine, according to Mr Cummings.
California congresswoman Loretta Sanchez told CNN that it is “likely” the suspect had been aiming at TSA officers.
He was not a TSA employee, she added, contradicting US media reports suggesting he may have had links to the agency.
A local hospital official told reporters that one of the injured was listed in a critical condition, while two other victims were listed in fair condition.
The Federal Aviation Administration barred all flights from landing at the airport during the incident, and outbound flights were delayed.
Airport officials said 746 flights nationwide had been affected and 46 were diverted.
Terminal 3 remains closed as the investigation continues.
President Barack Obama expressed concern about the shooting, but said he would leave law enforcement to talk about it.
Send your pictures and videos to firstname.lastname@example.org or text them to 61124 (UK) or +44 7624 800 100 (International). If you have a large file you can upload here.
Read the terms and conditions