A man accused of shooting a security guard dead in a packed Los Angeles airport terminal was charged with murder as he fought for his life while detectives tried to piece together motives for the attack.

Paul Anthony Ciancia, 23, faces charges of murder of a federal officer and committing violence at an international airport, US attorney Andre Birotte said on Saturday night. Under the charges, federal prosecutors could seek the death penalty, he said.

Ciancia opened fire, allegedly killing an unarmed security officer and injuring five others, starting panic among passengers. He was wounded in the leg and face during a gunfight with police.

Detectives said the gunman was dressed in military fatigues and had been carrying 150 rounds of ammunition when he was cornered in a food court. In his bag was found a one-page, handwritten note saying he wanted to kill airport security workers and "pigs".

One law enforcement official told the Associated Press that the note appeared to indicate the gunman was a "pissed-off patriot" who believed his constitutional rights were being violated by airport security searches.

Little is currently known about Ciancia, who moved to California from New Jersey 18 months ago. US media reports said his family, who run a garage in the town of Pennsville, told police before the attack that they had received a text message saying he planned suicide.

"Their younger child got a text message from Paul, stating that there were some comments in there about his wellbeing and he wanted to possibly take his own life," said local police chief Allen Cummings.

FBI agents were searching Ciancia's home in the Los Angeles area on Saturday. Two flatmates questioned by police said they had seen Ciancia a day earlier and he had appeared to be fine.

"Our goal is to do a true scrub on the individual to find out what was the tipping point for this person," FBI special agent David Bowdich told Reuters.

The attack at America's third-busiest airport began at about 9.20am local time on Friday, when the gunman pulled a rifle from his bag inside Terminal 3, pushed his way through security gates into a boarding area and started shooting.

"I really thought I saw death," said Anne Rainer, who had been waiting for a flight to New York.

The incident affected an estimated 1,550 flights carrying more than 167,000 passengers.