Ala ud-Din has been imprisoned in a cave by his uncle, the Vizier, who plans to marry Ala ud-Din's love, Badroulbadour. When the TARDIS materialises in the cave, Ala ud-Din thinks the Doctor is a djinni and asks for three wishes. His wishes happen to coincide with what the Doctor needs to do anyway, so his efforts to convince Ala ud-Din that he isn't a djinni fail.
The Doctor is searching for an alien, who happens to be the Vizier. He defeats the alien, sending him back where he belongs, and Ala ud-Din is free to marry Badroulbadour.
- The story is a brief retelling of the tale of Aladdin, with the Doctor mistaken for the genie ("djinni").
- A few exchanges of dialogue are humourously evocative of a pantomime.
to be added