It cost him $100,000 to find this ticket to ride.

A German airplane enthusiast restoring an old jet found an unexpected lost treasure hidden in a wall — a boarding pass used by John Lennon and showing The Beatles once flew on his plane.

Nils Alegen, 37, spent $100,000 working on the cockpit of the abandoned 1960 Sud Aviation Caravelle to make it into a flight simulator.

But he could never imagine the “fab” treasure it contained. Lennon’s boarding pass led him to discover that the Fab Four had flown from Manchester, England, to Paris, France, in his plane in 1964. Alegen says he later found a photo of The Beatles posing on the steps of the plane.

“When I disassembled the whole cockpit, that boarding pass showed up, together with many other papers between the cockpit and galley wall,” Alegen of Munich told Caters News.

“The galley is located right behind the cockpit. A flight attendant must have kept it and certainly lost it at some point.”

Alegen spent four years lovingly restoring the cockpit — and now aims to attract “day trippers” with simulated rides, using special screens to make it seem as if they are flying over various locations, including the New York skyline.

“It was a labor of love,” he said of his massive restoration project.

“People love it. Its got a very iconic cockpit, which feels like sitting in a science-fiction space ship.”

Alegen said he fell in love with planes when his mother worked as a flight attendant and knew the rusting Caravelle was the aircraft he wanted to work on after finding it abandoned in an airfield near Paris in 2012.

“As soon as I saw it, I knew it was perfect,” he said, eventually having it transported back to Germany and spending 5,000 hours restoring it.

“When I arrived at the airfield, I was asked, ‘What do you want with an old rust bucket?’

“I love everything about the aircraft. I love the shape, it’s very clean, unique and elegant.

“There’s no other aircraft like it, it’s really unique in its design,” he said.