Eternal Machine

From Tardis Wiki, the free Doctor Who reference

The Eternal Machine was worshipped by a humanoid species on an Earth-like planet.

In reality, the Machine was an alien that had crashed on the planet over a thousand years before the Third Doctor visited the planet. The alien was injured and entered into a regenerative sleep. For the next several centuries, it influenced the development of the planet's civilisation, manipulating the people.

The Doctor exposed the religion as a lie, and showed the people that their Eternal Machine was an alien that killed initiates, using their minds to grow more powerful. The people burned down the Sanctuary of Stars, seemingly killing the alien. However, the Machine's mind lived on inside the planet's flies. (PROSE: The Discourse of Flies)