At least three eyewitnesses spotted al Qaeda hijackers casing the security checkpoints at Boston’s Logan Airport months before the 9/11 attacks. They saw something and said something — but were ignored, newly unveiled court papers reveal.

One of the witnesses, an American Airlines official, actually confronted hijacking ringleader Mohamed Atta after watching him videotape and test a security checkpoint in May 2001 — four months before he boarded the American Airlines flight that crashed into the World Trade Center.

The witness alerted security, but authorities never questioned the belligerent Egyptian national or flagged him as a threat.

“I’m convinced that had action been taken after the sighting of Atta, the 9/11 attacks, at least at Logan, could have been deterred,” said Brian Sullivan, a former FAA special agent who at the time warned of holes in security at the airport.

The three Boston witnesses were never publicly revealed, even though they were interviewed by the FBI and found to be credible. Their names didn’t even appear as footnotes in the 9/11 commission report.

But what they testified to seeing — only revealed now as part of the discovery in a settled 9/11 wrongful-death suit against the airlines and the government — can only be described as chilling.

I said, specifically, ‘These two clowns are up to something. They’ve been taking videos and pictures down at the main checkpoint.’ - Stephen J. Wallace, American Airlines technician

Stephen J. Wallace, a 17-year American Airlines technician, first alerted Logan authorities that two Middle Eastern men — one of whom he would ID as Atta from a photo array following the attacks — were acting suspiciously outside the main ­security checkpoint.

He remembers it vividly. It was the morning of May 11, 2001. One was videotaping and taking still photos of the flight board and the checkpoint from about 25 feet away, while the other was talking loudly in Arabic on a cellphone. The behavior went on for 45 minutes.

Wallace was so disturbed, he walked over to them and asked about the contents of their carry-on luggage, which he described as “brand-new” pilot bags.

“I said, ‘You guys don’t have any of this stuff in your bags, do you?’ ” pointing to a kiosk display of prohibited items.

“One of them said to the other, gesturing at me, called me a rather nasty name in Arabic,” Wallace added, explaining that he recognized the word because “I swear in Arabic.”

They then nervously packed up their bags and raced to another checkpoint, with Wallace hot on their heels. Before they entered the other checkpoint, Wallace alerted several authorities.

“I said, specifically, ‘These two clowns are up to something,’ ” he testified. “’They’ve been taking videos and pictures down at the main checkpoint.’”

But authorities never followed up. The men boarded an American flight to Washington, DC.

Theresa Spagnuolo, an American Airlines passenger screener, told federal agents after the attacks that she also observed a short Middle Eastern man — Atta — videotaping the main security checkpoint in May 2001.

“She was bothered by Atta’s filming, so she spoke to her supervisor about it” and he “informed her it was a public area and nothing could be done about it,” the agents said in their investigation.

Her supervisor was James Miller Jr., who would later testify, “It looked weird to me.”

He said he reported Atta to higher-ups, who told him, as he relayed to Spagnuolo, that there was nothing they could do about it.

In fact, airport security had clear authority to investigate anybody surveilling a checkpoint at the time, and such activity should have raised major red flags. Just two months earlier, federal authorities advised airlines, including American, that al Qaeda terrorists typically conduct surveillance before attacking a target.

Instead, the worst terrorist hijacker in history was allowed to waltz through security without anyone stopping him, asking his name, checking his ticket, taking a picture, looking at his driver’s license or passport, opening his bags or patting him down.

The worst terrorist hijacker in history was allowed to waltz through security without anyone stopping him, asking his name, checking his ticket, taking a picture, looking at his driver’s license or passport, opening his bags or patting him down.

And Logan had failed to install security cameras at the checkpoint, so an image of Atta and his May 11 visit was never taken.

Four months later, on Sept. 11, Atta passed through the same security checkpoint. His carry-on bag got past screeners despite containing box-cutters and mace or pepper spray. He took his seat in business class on American Airlines Flight 11 unimpeded.

The eyewitness accounts surfaced in a lawsuit brought by the family of Mark Bavis, a Los Angeles Kings hockey scout who died in one of the hijacked Boston flights. Because the case was settled in 2011 for several million dollars and never went to trial, the evidence never aired in open court.

Over the objections of federal authorities, the Bavis lawyers later made the risky decision to dump the FBI interviews and deposition transcripts into the public archives.

The testimony is expected to factor prominently in another 9/11 lawsuit brought against the airlines by the owner of World Trade Center Properties. That case, which is on appeal, is expected to be heard next year.

Paul Sperry is a Hoover Institution media fellow and author of “Infiltration: How Muslim Spies and Subversives Have Penetrated Washington.”