Delhi (CNN) — Frequent flier Rajan Mahbubani thought he had discovered the ultimate hack for getting preferential treatment at airports. Instead it got him arrested.

In a case that's been compared to the Leonardo DiCaprio conman movie "Catch Me If You Can," the 48-year-old allegedly donned the uniform of a Lufthansa pilot in order to fool airport workers into letting him bypass security lines and get seat upgrades.

It apparently worked too, right up until the point he was caught at Delhi's Indira Gandhi International Airport on Tuesday evening.

Mahbubani was dressed in a pilot's uniform when arrested at the departure gate as he was about to board an AirAsia flight from Delhi to Kolkata, police said.

Related content Young man caught posing as senior citizen to fly to US

Sanjay Bhatia, the airport's deputy commissioner of police, told CNN that a Lufthansa employee had alerted airport security that a "suspected passenger was impersonating a captain of Lufthansa airline."

This came after AirAsia had called Lufthansa to verify his identity.

Mahbubani, who is from New Delhi, was detained and handed over to Delhi Police. He was found carrying a fake Lufthansa pilot ID that he used to gain privileges at airports.

"After his arrest, Mahbubani told us he used to shoot YouTube and TikTok videos on aviation and had obtained the Lufthansa fake ID card in Thailand," Bhatia said.

'Cheating and impersonating'

Police say they recovered photos of Mahbubani, seen in the center here wearing a cap, dressed in an army uniform. Delhi Police

Airport security officials were already on the lookout for him, apparently, because of videos on his social media platforms.

Police said Mahbubani subsequently told police he liked to dress up in uniforms. They recovered pictures of him dressed in an army uniform from his phone.

"Mahbubani said that he was a frequent flier and used to dress up as a pilot to gain easy access through security, get preferential treatment from security agencies and airlines and seat upgrades," said Bhatia. "He would use the passage normally used by airline crew."

Related content Chinese pilot grounded after photo of woman in cockpit sparks outrage

He's now in custody facing charges of cheating and impersonating. If convicted he could face a year in prison or a fine, or both.

Mahbubani's alleged impersonation recalls the real-life exploits of serial fraudster Frank Abagnale, who impersonated flight crew to get free travel during a career of crime that was later dramatized by Steven Spielberg in the 2002 movie "Catch Me If You Can."