After 55 years, Doctor Who season 11 has finally introduced Time Lord religion. Although it’s generally been assumed that the Doctor isn’t religious, the show has always had a nuanced view of faith. Jon Pertwee’s Third Doctor, for example, was deeply attracted to the Buddhism - and indeed, in “Planet of the Spiders” he met a fellow Time Lord who was living as a Buddhist Monk. Many episodes have explored the idea that powerful aliens are the basis behind legends of gods and - most frequently - devils; “The Pyramids of Mars” explored the aliens behind Egyptian mythology; “The Daemons” unveiled the creatures who inspire tales of the Devil, and “The Satan Pit” unforgettably revealed a corrupting force that even the Doctor could barely begin to explain or understand.

But neither the Time Lords nor the Doctor has ever been shown to have any sense of religion. The closest the Doctor has come to faith is in his belief in his friends; as the Tenth Doctor objected in “The Satan Pit,” “I’ve seen fake gods and bad gods and demigods and would-be gods; out of all that, out of that whole pantheon, if I believe in one thing - just one thing - I believe in [Rose].” There’s a similar scene in the classic story “The Curse of Fenric,” where the Seventh Doctor had to call forth a great deal of faith - and did so by thinking of his companions.

The latest episode of Doctor Who, “It Takes You Away,” seems to have revealed an ancient Time Lord religion. The Doctor tells Yaz about the legend of the Solitract, and it’s pretty clear that she’s describing an ancient creation myth; she even started off with the phrase “In the beginning,” evoking memories of Genesis 1. The Doctor seemed to describe the Solitract as one of at least two consciousnesses that existed before creation; the Solitract was inimical to the rules of reality, and thus was “exiled.” Given the Time Lords love order above all else, the Solitract seems to be the Gallifreyan idea of the Devil, a being whose very presence in reality causes the rules of existence to break down.

Of course, the Doctor soon winds up learning to have sympathy for the Devil. The Solitract isn’t malicious; it’s just lonely, and is desperate to interact. Tragically, this desire for relationship may well have led to its destruction, as the Solitract Plane crumbled around it.

It’s interesting to note that the Doctor doesn’t describe the Solitract as a Time Lord legend, though; instead, she considers it one of Granny Five’s bedtime stories. Granny Five (one of seven grandmothers) is presented as something of an eccentric, right down to claiming that another of the Doctor’s grandparents was a Zygon spy. So it seems safe to say the creation myth of the Solitract is one that has fallen out of favor in Gallifrey; given there’s never been a mention of Gallifreyan religion before, it seems organized religion has largely died out. Old tales and legends do still persist as folklore, though.

The Time Lords seem to have used science as a substitute for religion. The Matrix, for example, is the Time Lord equivalent of an afterlife; it’s the Time Lords’ most sophisticated computer system, and any dying Time Lord’s mind is uploaded into it so they live on after death. The Matrix is used to scan the future, and it issues cryptic “Matrix Prophecies” every bit as apocalyptic as the Book of Revelation. It would hardly be surprising if the various Gallifreyan symbols and icons, such as the Seal of Rassilon, were originally religious iconography that has been repurposed in modern Time Lord society. It would certainly be like Rassilon to make his symbol an old Gallifreyan sign for “power.”

Curiously, exile is the worst punishment the Time Lords can bestow upon a criminal or a Renegade. Perhaps the reasons for this are cultural, and have their roots in the ancient myth of the Solitract. If that’s the case, there’s a certain irony in the Doctor - who was once exiled from her people - being the Time Lord to encounter the Solitract.

More: Why Doctor Who Has Completely Divided Fans This Season

Doctor Who season 11 concludes this Sunday, December 9, on BBC America.