Richard A. Serrano, Joseph Tanfani and Kate MatherThis post has been corrected. See the note below for details.

The semiautomatic rifle used in the LAX shooting rampage Friday was purchased at a Van Nuys gun store and could fit into the bag the alleged gunman brought to the airport, a federal law enforcement source told The Times.

The source said the weapon was a Smith and Wesson M&P 15, 5.56-millimeter and .223-caliber, which was purchased at the Target Range Gun Store, 16140 Cohasset St., Van Nuys.

The source said the weapon is not “collapsible,” but it could “easily fit ready to fire” into the luggage bag the alleged shooter brought into the airport, added the source, who spoke on the condition of anonymity because the case is ongoing.

Paul Anthony Ciancia, 23, an unemployed motorcycle mechanic, was wounded by LAX police as he shot his way through Terminal 3 shortly after 9 a.m. Friday, authorities said. Ciancia was shot four times in the head and a leg and is heavily sedated and under armed guard at a hospital Monday.

A Transportation Security Administration agent, Gerardo Hernandez, 39, was killed, and two other TSA agents and at least one civilian were wounded during the shooting rampage. Hernandez was the first TSA agent to be killed in the line of duty since the agency's formation in the aftermath of 9/11.

Federal prosecutors on Saturday filed murder charges against Ciancia as they pieced together a possible motive.

Ciancia moved to Los Angeles about 18 months ago, said Allen J. Cummings, a friend of Ciancia's father and the police chief in Pennsville Township, N.J., where Ciancia grew up. There had been no indication that Ciancia was struggling, Cummings said, or that he may have harbored anti-government sentiments.

"We don't really know what happened out West," Cummings said. "We don't know where he got his ideas or where that came from."

The gunman was carrying a signed, handwritten note in his duffel bag that said he wanted to "instill fear into their traitorous minds," said David Bowdich, special agent in charge of the Counterterrorism Division in the FBI's Los Angeles office.

"His intent was very clear in his note," Bowdich told reporters Saturday. "In that note he indicated his anger and his malice toward the TSA officers."

Brian Ludmer, 29, was on his way Friday to celebrate a friend’s wedding over the weekend when he heard gunshots inside Terminal 3 and “people were running everywhere,” Las Virgenes schools Supt. Dan Stepenosky said in an interview.

As the gunman took aim, Ludmer turned to run and dived away, but was struck at least once in the leg, Stepenosky said. Ludmer dragged himself into a closet, closed the door and hunkered down, fearing the worst.

“He really assumed he was not going to make it,” Stepenosky said.

The performing arts teacher managed to create a makeshift tourniquet to help slow the bleeding, using “his old Boy Scouts training,” Stepenosky told NBC Los Angeles.

Ludmer waited until he heard what he believed was a police officer outside the closet. He cracked open the door, peeked out and was rushed by the officer into a waiting ambulance.

Word of Ludmer's injuries somehow reached his parents in Chicago. They, in turn, called Calabasas High, alerting a couple of Ludmer's colleagues in the performing arts department.

“They said he was involved in a shooting,” Stepenosky said. “So the teachers and the principal went to the hospital right away.”

Calabasas Principal C.J. Foss and two teachers held vigil at the hospital while Ludmer's mother made her way to Los Angeles to be at her son's side, Stepenosky said.

[For the record, 12:20 p.m. Nov. 4: An earlier version of this post stated a law enforcement source said the LAX gunman was carrying a .556-caliber rifle. The source said he was carrying a 5.56-millimeter, .223-caliber rifle.]

[For the record, 3:27 p.m. Nov. 4: An earlier version of this post stated that the gun was collapsible; it was not.]