What’s the Link Between Doctor Strange and The Beatles — and What Does Paul McCartney Have to Do with It?

Now that’s one magical mystery tour.

Doctor Strange and The Beatles may seem like strange bedfellows, but there’s actually a curious, fortuitous connection between them.

Get push notifications with news, features and more.

On Thursday, at the Hollywood premiere of the mystical superhero film based on the cult Marvel comic book, composer Michael Giacchino (you might know his music from The Incredibles and Ratatouille) chatted with PEOPLE about creating the score for it. That score, he says, was actually recorded at London’s vaunted Abbey Road Studios — the legendary venue where The Beatles laid the tracks to their most iconic albums and singles.

There was, however, another magical twist: During one particular day, while recording the music to the Benedict Cumberbatch-headlined film, which opens Nov. 4, Giacchino discovered that there were two special visitors at the studio.

“When we got to Abbey Road one day, there were all these security guards around, and I’m like, ‘What is going on here? What’s happening?’ ” the tunesmith recalls. “And they said, ‘Oh, Paul [McCartney] and Ringo [Starr] are in there doing PR for the Ron Howard film that they just put out.”

That film was the well-received Beatles documentary Eight Days a Week. And, as it happens, Giacchino knew McCartney.

“I was like, ‘Oh, that’s great,’ ” he explains. “I had worked with Paul McCartney on a project, a little while back. So I just sent them a note. I said, ‘Hey, I’m next door. If you have a chance, come by.’ ”

The legendary musician was happy to oblige.

“So, he came by, and the director, Scott Derrickson, is this huge, huge, huge Beatles fan. He couldn’t believe it.”

The visit turned out to be a prescient one: Giacchino happened to be working on a track that he says actually echoed The Beatles’ distinct sound.

“Paul came in while we were recording this cue that sounded like it literally could have come off of one of their albums, that was recorded in that building, all those years ago,” he says. “And Paul leans over, and he goes, ‘This has got shades of ‘Walrus’ in it,’ ” — name-checking the band’s trippy 1967 thumper “I Am the Walrus.”

That moment, Giacchino muses, “will be forever one of my favorite things.”

“He’s obviously the best songwriter and musician we’ve ever known,” the composer says, “and to have him be there, that was kind of cool.”