LOS ANGELES – A man pulled a semiautomatic rifle from a bag and shot his way past a security checkpoint at Los Angeles International Airport Friday, killing a TSA officer and wounding two other people in an attack that sent terrified travelers running for cover and disrupted flights from coast to coast, authorities said.

The unidentified gunman was wounded in a shootout with police and was taken into custody, said Los Angeles police Assistant Chief Earl Paysinger. A motive wasn’t immediately clear. A Transportation Security Administration union official said the TSA officer was killed, citing local union officials.

A law enforcement official said the shooting suspect is Paul Ciancia, 23, from New Jersey. He was wearing fatigues and carrying a bag containing a hand-written note that said he “wanted to kill TSA and pigs,” the official said, who was briefed at LAX on the investigation and requested anonymity because was he was not authorized to speak publicly.

A second law enforcement official confirmed the identity, speaking on condition of anonymity because he was not authorized to discuss the investigation publicly.

The TSA issued a brief statement Friday afternoon indicating that at least one other TSA agent was wounded, adding that further information would come from the FBI and police.

As gunshots rang out in Terminal 3, panicked fliers dropped to the ground. Those who had made it past security fled onto the tarmac or sought cover inside restaurants and lounges.

“We just hit the deck. Everybody in the line hit the floor and shots just continued,” said Xavier Savant, who was waiting in the security line where the shooting occurred. He described it as a “Bam! Bam! Bam!” burst of gunfire.

Savant said the shots subsided and people bolted through the metal detectors and ran into the terminal, eventually making their way out to the tarmac.

“My whole thing was to get away from him,” said Savant, an advertising creative director who was heading to New York with his family for a weekend trip.

Los Angeles Airport Police Chief Patrick Gannon said that around 9:20 a.m., the gunman pulled what he described as an “assault rifle” from a bag and began firing inside Terminal 3. He then went to the security screening area, where he fired more shots and went into the secure area of the terminal, Gannon said.

Officers exchanged fire with the gunman and apprehended him; police believe he was the only shooter, Gannon said. “As you can imagine, a large amount of chaos took place in this entire incident,” he said.

Tim Kauffman, a spokesman for the American Federation of Government Employees in Washington, confirmed Friday that a Transportation Security Administration officer was killed. Kauffman said the union’s information comes from their local officials in Los Angeles.

As police searched for other shooters, they escorted travelers out of the airport. Aviation officials stopped flights destined for of the nation’s busiest airports from taking off from other airports, causing delays across the country. Some flights also had to be diverted to other airports.

It was not the first shooting at LAX. On July 4, 2002, a limousine driver opened fire at the airport’s El Al ticket counter, killing an airline employee and a person who was dropping off a friend at the terminal. Police killed the man.

Witness Brian Keech said he heard about a dozen gunshots from inside a security gate at the terminal.

Ben Rosen was sitting at the Starbucks in Terminal 3 eating oatmeal at about 9:20 a.m. when he heard gunfire erupt and people start running in all directions and others crouching on the ground. Rosen got on the ground and another passenger said: “Don’t worry, we’re safe.”

Then, more gunshots erupted. He grabbed his phone and tried to lie as flat on the ground as he could. Police showed up with their guns drawn, shouting, “This is not a drill! Hands up!”

Everyone put their hands up and then were led out of the airport terminal to the international terminal, Rosen said. As they were led out they saw broken glass from a window that looked like it’d been shot out. Rosen left his bag behind.

Six people were taken to the hospital, the Los Angeles Fire Department said. It’s unclear whether the gunshot victims were among the group.