The Third Doctor and Sarah Jane Smith arrive in a deserted London plagued by looters and lawlessness where the United Nations Intelligence Taskforce is assisting with maintaining martial law. The regular army, headed by General Finch, has evacuated the entire city and issues a command that any looters in London will be shot on sight. The Doctor and Sarah are soon arrested on suspicion of being looters themselves but are identified from the photographs by Brigadier Lethbridge-Stewart, who is heading up the UNIT operation, and arranges that the pair are freed to help combat the monsters that have necessitated the evacuation of London. Dinosaurs have started appearing all over the city – but that is not all, as the Doctor comes across a medieval peasant from the days of King John, who disappears in a time eddy. It seems the dinosaurs have been present for several months, but nobody can account for their sudden appearance or the havoc they are causing. The British Government has been relocated to Harrogate during the crisis, and the army has taken charge to ensure an orderly evacuation and to try and maintain some sort of control in the city. The dinosaur appearances are various – pterodactyls, Stegosaurus, Tyrannosaurus rex – but the creatures seem to vanish as mysteriously as they appear.
The Doctor ventures out around the city with a UNIT escort, hoping to learn more of the curious phenomenon, and they encounter a Stegosaurus moments before it disappears. He starts to suspect someone is deliberately bringing the dinosaurs to London – and in a hidden laboratory a pair of scientists, Butler and Professor Whitaker, are shown operating the Timescoop technology that is making the situation possible. They are being aided by Captain Mike Yates from UNIT, who is revealed to be recovering from a nervous breakdown caused by the events depicted in The Green Death. Mike feels the Doctor could help them achieve Operation Golden Age, but Whitaker is unconvinced, and tells Mike to sabotage the stun gun, which the Doctor is building for use on the dinosaurs. He does this, imperilling the Doctor when he encounters a Tyrannosaurus rex, but the situation is saved and the creature is stunned and captured. Hours later, however, General Finch sets it free, evidently part of the conspiracy too.
Sarah Jane has meanwhile set off to gather her own evidence and meets with Sir Charles Grover, an ecologist MP who is acting as Minister with Special Responsibilities in London. She is drugged by him and when she wakes up is astounded to find herself on a vast spaceship. The crew include Mark, Adam and Ruth, all famed British minor celebrities who have adopted new aliases and lives. They tell her they en route for a New Earth where mankind can begin again, closer to nature. They left Earth three months earlier and the ship is one of a fleet that is carrying over two hundred people to a new life. Sarah is committed to the re-education programme to enable her to think like them.
The Doctor now focuses on more searches of London using his new vehicle, the Whomobile, as transport. Under Trafalgar Square tube station he finds the base used by Whitaker and Butler, but is scared away when they use a pterodactyl to defend their lair. When he returns with the Brigadier, the signs of occupation have been removed. Operation Golden Age is revealed to be a broad conspiracy containing Whitaker, Butler, Yates, Grover and Finch as its core co-ordinators. They have emptied London to enable it to revert to a more natural state, after which the people on the spaceships (in reality they are in vast bunkers and not in space at all) will be allowed out and enabled to repopulate a clean and free planet. Whitaker also works out how to reverse time, so that soon none of humanity apart from their own chosen specimens will ever have existed.
Finch tries to frame and discredit the Doctor, whom he knows will not support their plans, and the Doctor soon twigs that an over-zealous Yates is the UNIT mole. Sergeant Benton lets the Doctor escape, for which Finch threatens a court martial. The Doctor uses his freedom to track down more monsters, but when he is recaptured the Brigadier asserts his authority and takes the Doctor into UNIT custody rather than the regular army’s.
Sarah has meanwhile escaped from the fake spaceship having learnt its true nature, but is apprehended by Finch, who tracks her down and returns her to Whitaker’s custody. While she is away Mark works out that the ship is a fake too and exposes this to the other passengers, but he is not believed. When Sarah is returned to the ship she and Mark use the fake airlock to convince Ruth and the others of the depth of the deception
Shortly afterward Finch and Yates reveal their hands to the Doctor, Benton and the Brigadier, and reveal the nature of their plans. The Doctor and the Brigadier get away once more and head back to the base, evading dinosaurs en route, where they confront Grover and Whitaker. The duped environmentalists from the fake spaceship also appear, along with Sarah, and demand an explanation. In the ensuing fight Whitaker and Grover are transported back through the Timescoop to the Golden Age they sought to bring to modern Britain.
Back at UNIT HQ, the Brigadier confirms to the Doctor that the crisis is over, but there are still some human casualties to deal with. Finch will face a court martial while Yates is being offered the chance to resign and given extended sick leave. The Doctor reflects that people like Grover may have had good motivations in wanting to fight pollution and environmental degradation, but they took their schemes too far and endangered all mankind and its civilisation. He decides it is time for a holiday and offers to take Sarah Jane to the holiday planet of Florana.