The real Beatles in 1965, and the Doctor in 'The Devil's Chord.'

When that most seasoned of time-travelers, the Doctor (Ncuti Gatwa), returns to our screens Friday, he’ll be making what he says is his first visit to the Beatles. 

In the second episode of the new season of Doctor Who, “The Devil’s Chord,” TARDIS co-habitant Ruby Sunday (Millie Gibson) declares she’s always wanted to see the band, so an excited Doctor whisks her away to 11 February 1963 when the Fab Four recorded their first album, Please Please Me, in a single day. 

Now, Ncuti’s Doctor is technically correct (and right to be surprised!) that his previous incarnations have never been to see the Beatles. Neil Gaiman intended otherwise: he wrote a scene where Matt Smith’s Doctor and Amy Pond (Karen Gillan) see the group’s famous Shea Stadium performance at the opening of his 2011 episode “The Doctor’s Wife,” but that never made it to screen. 

And yet the Beatles — the real ones, not the barely-lookalike versions seen in “The Devil’s Chord” — did perform on Doctor Who once before, almost appearing as their future selves.

The biggest band in the world and the longest-running drama in the world both arrived on the scene in 1963, and have had a long-and-winding, timey-wimey history together ever since. 

The Beatles 50th Anniversary concert … in 1965? 

Two years into their magical mystery tours, the Beatles and the world of ‘Doctor Who’ collided multiple times. 

One of these collisions was in person, and it took place at the Cannes film festival in May 1965. A lone Dalek (one of a squadron in France to promote the Peter Cushing movie Dr. Who and the Daleks) was photographed running into John Lennon and this then-wife Cynthia at breakfast. The Lennons, there to promote the band’s surreal second movie, Help!, looked nonplussed

That same month, the BBC started screening another Dalek serial on Doctor Who, “The Chase.” Over six episodes, in a madcap escape across time and space, the first Doctor (William Hartnell) and his companions fled the evil pepper pots that menaced the Lennons. 

But first, they relaxed with a goofy, never-to-be-seen-again Time and Space Visualizer (taken from the previous serial’s “Space Museum). After tuning in to Shakespeare and Abraham Lincoln, the TARDIS team rock out with some embarrassing dancing to … a performance by the Beatles of their latest chart hit. 

Less than a minute into “Ticket to Ride,” as the Doctor and schoolteacher Ian (William Russell) are bopping away like awkward dads, schoolteacher Barbara (Jacqueline Hill) accidentally turns the performance off. “You’ve squashed my favorite beetles,” jokes the Doctor.

Vicki (Maureen O’Brien), a British space colonist from the far future, then tells her aghast friends from the 1960s that the Beatles are considered classical music in her time. “I’ve been to their memorial theater in Liverpool,” says O’Brien — who was from Liverpool herself. (There is no Beatles Memorial Theater in Liverpool yet, though even O’Brien might have been shocked to learn about John Lennon International Airport.)

What the BBC producers had proposed, according to the seminal Doctor Who: The Complete History, was even wilder: the live performance would pose as footage from a Beatles “50th anniversary” concert, presumably in the 2010s. Playing their older selves, the band would wear long gray beards.

One could imagine the four jokesters — Goon Show lovers who had already appeared on many UK TV comedy shows — really getting into the idea. Indeed, they would do something very similar in animated form three years later, during the “When I’m Sixty Four” segment of Yellow Submarine. 

But the band’s manager, Brian Epstein, turned the Doctor Who team down: he felt it would be bad for his boys’ image. Instead of inventing elder mop tops, then, the show simply grabbed a Beatles performance that the group had filmed the previous month, in Doctor Who‘s regular studio, for another BBC show — Top of the Pops. Epstein consented to a very short clip being used, hence Barbara’s accident with the off switch.

In a final timey-wimey twist worthy of the Doctor, episode 1 of “The Chase” is now the only place you can see that particular Beatles performance since the BBC regularly wiped its TotP tapes. (Unfortunately, thanks to copyright issues, the segment isn’t available in U.S. versions of “The Chase.”)  

Epstein’s decision was a disappointment for the show. But it would turn out to be a tragedy for the band, which missed its only opportunity for a 50th anniversary concert.

Not only did the Fab Four quit the concert scene for good a year later, and quit each other in 1970, but two members of the band would be dead long before its 50th birthday. 

Yesterday and today

By 1973, the Doctor seems to have quit following the group once described as “my favorite beetles.” That was the year the second Doctor (Patrick Troughton) and the third (Jon Pertwee) met in the TARDIS, confusing companion Jo Grant (Katy Manning). 

“It’s all quite simple,” Pertwee’s Doctor says. “I am he and he is me.” 

“And we are all together,” replies Jo, “goo goo g’ joob?” But neither Doctor knows the song she’s referencing. Did he, in common with a lot of old folks in the 1960s, quit listening to the Beatles around the Revolver album, when they got weird? 

All we know is that by the time of the new show, the Doctor seems to have become a fan again. David Tennant’s Doctor helps with a crucial security question on a sunbound spaceship in the 2007 episode “42” by correctly calculating whether the Beatles or Elvis have had more number 1 hits.

Matt Smith’s Doctor, attempting to escape his fate in 2011’s “The Wedding of River Song,” muses about joining the Beatles. 

And perhaps the Doctor still can, in his Ncuti Gatwa incarnation.

Judging by the way he handles a couple of the Beatles’ instruments in “The Devil’s Chord,” providing inspiration to Lennon and McCartney in the process, the group could get by with a little help from its oldest fictional fan.

How to watch: Doctor Who streams Friday, May 10 at 7:00 p.m. ET on Disney+, where available, and simultaneously on May 11 at midnight on BBC iPlayer in the UK.