A Nigerian immigrant made a mockery of federal air security when he managed to board a flight from JFK to LA with a stolen, expired boarding pass — and then walked free, even after the flight crew discovered the breach and called the FBI, officials said yesterday.

Olajide Oluwaseun Noibi, 24, wasn’t arrested until a week after the disturbing series of blunders, and that was only because he allegedly tried to pull the scam again so he could fly to Atlanta for free.

Noibi had a dozen phony boarding passes in his luggage when he was finally busted Wednesday at LAX on stowaway charges, and told FBI agents he was able to fly there without paying, officials said.

The Romeoville, Ill., resident copped his free ride from New York to Los Angeles using a Virgin America boarding pass that an Upper West Side resident lost on June 23, possibly on the subway.

Even though the ticket was for that day, Noibi used it on June 24, and easily sailed past the Transportation Security Administration checkpoint at JFK’s Terminal 4, sources told The Post.

He showed the agent a report from the Chicago Police Department saying his passport was stolen, and presented a University of Michigan ID, the sources said.

The screener was suspicious enough to call for her supervisor, who somehow didn’t notice that the boarding pass was not for Noibi, the source said.

Noibi continued to the gate, where it was the airline’s turn to drop the ball.

When the gate agent scanned the expired boarding pass, a red light went off to indicate it was not legitimate — “and he’s still allowed to board,” a source said of the event, which was captured on video surveillance.

Virgin American Flight 415 departed on time with Noibi on board — but not on the manifest.

During the trip, at least two passengers complained that Noibi smelled bad, and airline officials finally figured out he was in an unsold seat.

They alerted authorities from the air.

LAPD cops, TSA officials and an FBI agent met Noibi when the plane landed at 1 a.m.

He was detained for a mere four hours, then released without being charged.

The TSA released a statement saying “this passenger was subject to the same physical screening at the checkpoint as other passengers.”

A Port Authority police official, furious at the security breakdown, said the TSA “failed in its due diligence to notify the proper law-enforcement entities, the results of which could have been devastating.”

An FBI spokesman said Noibi was initially released because he “posed no threat at the time.”

philip.messing@nypost.com