The TARDIS receives a distress signal which the Doctor says is temporal in nature, sent to a point just after a ship's take-off in order to facilitate rescue. As such, the TARDIS lands in the Battani 045 system. When they step out, the Doctor and Amy find themselves on something resembling a huge scrap yard, including the remains of the Pioneer 10 probe launched by NASA in 1972.
The year is 250,339.
In the sky above is the comet, Schuler-Khan. Suddenly a buggy pulls up, driven by two grey-skinned aliens. One pulls out a rifle. The two aliens, Charlie and Ahmed, recognise the Doctor and Amy as humans but think that they have become detached from a scouting party. Ahmed tells them that they are prisoners and will be used as bargaining tools. The Doctor tries to explain that they are answering a distress signal and have come to help. He points to the TARDIS but the aliens are not convinced.
The two travellers are told to get into the buggy and are driven across the metallic landscape. Suddenly a ball of burning refuse tumbles down a slope towards them. As the driver swerves the Doctor falls out. Apes in ragged clothes descend on all sides. Charlie hits the accelerator, despite Amy's protests, as flaming arrows are fires at the buggy. The Doctor is captured.
The buggy arrives at a wrecked spaceship: the Beagle XXI. Ahmed goes to find the captain, Charlie's father. Charlie tells Amy that his people are the Sittuun. Since encountering a Syrian cargo vessel (their first contact with aliens) they have used Earth names and human language when dealing with humans since their own language has proved unpronounceable for people from Earth. However, when Captain Jamal arrives he uses his own language, a series of clicks and whistles, which the TARDIS doesn't translate. Jamal is amazed to find that Amy knows she is from Earth and leads her inside.
In the ship are four aliens: Jamal, Charlie, Ahmed and Dr. Heeva. Amy tells them about her travels in the TARDIS including the space whale and the Doctor being a Time Lord. They don't believe her. In return they tell her that she is on the Gyre. This is a vast collection of debris which has been growing for at least 300,000 years. They have come here to destroy it with a nanobomb before the Schuler Khan comet hits it. There are only hours to go before the impact which will send chunks of debris as large as cities towards the twelve populated worlds of their solar system. They add that they didn't know the Gyre was populated until they arrived. Amy asks who the apes were that took the Doctor. Jamal, with some surprise, tells her that they are humans.
The Doctor is tied up by his captors and led through a valley of scrap. Eventually, the party arrives at a vast gorge crossed by a pipe ten metres in diameter, which the Doctor explains is the exhaust from a Proamonian dreadnaught. Unimpressed, his captors force him across the 'bridge' at spear point. He wonders how long these humans have been on the Gyre.
They enter a swamp and as they cross there is a splash in the water nearby. The humans begin to mutter fearfully about a Sollog. Suddenly they are attacked by a slug-like creature with eight spindly legs and razor sharp teeth. The humans run. Two are attacked and fall but the others do nothing to help and leave them behind.
The Doctor helps up one man as the Sollog closes in. the Doctor tells the man to cut his bonds. The man does so and the Doctor uses his screwdriver, amplified through a plastic pipe, to drive the predator off. The human ties the Doctor up again and then leads him on across a salt plain towards an enormous wrecked spaceship standing like a tower high above the plain. Along one side it says GOBO and has the image of a blue-haired clown. Around the base of the ship are makeshift buildings. From them come the sound of drumming, torchlight and the stink of smoke and rotting food.
A short human emerges from a wrecked space shuttle. He is announced as Tuco. The Doctor asks how long these humans have been on this place. Tuco says he is speaking heresy: humans have always been here for this is Earth.
Amy denies that the ape creatures are humans but Charlie tells her that they are the remains of a shipwrecked crew, descendants of people who crashed thousands of years earlier. They have evidently forgotten both their technology and their history. Amy says they don't look human but Charlie says that they do to the Sittuun. He says that when his ship crashed 108 days earlier the humans killed three of the crew and took three more as prisoner. Another Sittuun, Aisha, was killed by a Sollog so now only four of the original eleven are alive. They have tried to salvage a raft ship to escape but something in the Gyre has scrambled the navigation systems. Amy asks why they didn't merely fire a missile to destroy the Gyre. He replies that their nanobomb is the largest ever made: it took funds from eight planets in the Battani system plus fifteen more worlds.
Amy's response is that the Doctor could have used the TARDIS to rescue them all. Charlie apologises for capturing them and adds that his father hates humans for their violence, superstition and predatory nature. As the Sittuun evolved on a world with no predators they have developed without a concept of fear. The first three of their crew to die were actually warning the humans about the approaching comet. The reward for their concern was to be killed and hung on the city gates. He tells her that the only options are to wait for the comet's impact or to detonate the nanobomb and be vapourised. Ahmed bursts in to tell them that an Earth vessel is approaching.
As they rush outside a small yellow ship streaks across the sky and lands nearby. The Sittuun and Amy run towards it, noting its name: The Golden Bough. A door opens and a man in a silver space suit steps out. He has a smile like a film star and introduces himself as Dirk Slipstream. He says that he is ex-Terran Airborne division and has come freelance to rescue them. Amy immediately tells him about the Doctor being captured and Slipstream says that it is a matter of honour to mount a rescue. Captain Jamal wants to leave and detonate his bomb at once but Slipstream says that his own reputation will be ruined if the story gets out that he left someone behind.
The Doctor is taken down a series of dark underground passages until he is led into a cell. On the way he talks to Sancho, his guard, about how the two of them escaped the Sollog. Sancho almost smiles at the memory but puts the Doctor into a cell. The Doctor tries his screwdriver on the lock but to no avail. He has a cellmate, Manco. This man tells him his story: he is a wordslinger, the only human who is permitted to read. He inherited this talent from his family. He says that Gobo created the world from junk and looks down from the top of his tower. Gobo gave the gift of speech to all but deprived most of the sinful gift of writing. However, when the star appeared Django sent Manco into the tower to find out what it was. He read a log and found that the tower was a ship that had crashed with 3000 people on board. Only five hundred survived. That ship was from Earth. When he returned to tell Django this news he was put in prison for heresy. The Doctor agrees with Manco, saying that Gobo is only a symbol of the Gobocorp freight company. Manco says that Django claimed the log and the Sittuun were tricks sent by 'The Bad', which is why the aliens were killed. Their conversation is interrupted by Tuco who comes to take the Doctor to Django.
Slipstream is preparing to leave with Amy and Ahmed. Charlie wants to go, too, but his father forbids him (saying that he will take Slipstream's ship and detonate the bomb as soon as the others have gone). Charlie says this is wrong but he seems more upset by Amy's anger when he fails to join the rescue attempt.
After being led back through the tunnels the Doctor passes into a large chamber where a hundred humans are watching westerns projected onto large sheets while robed humans intone commentaries on the moving pictures. The comments include references to Gobo's brother Wyturp. The Doctor realises that not only do the humans have a power supply but their mythology is based on centuries of watching westerns.
In the buggy, Ahmed tells Amy that Charlie went to Lux Academy in the Sol 1 system (Earth). He studied music there and took his name from Charlie Parker. Ahmed feels that Charlie is half human. As they drive across the surface Slipstream says he has often wondered about Gyre - legend tells that it contains the resting place of a fabulous treasure called the Mymon Key. He adds that this is probably a fairytale.
Charlie sits in his room, brooding, as his rifle charges. In the ship his father and Dr. Heeva prepare the nanobomb. Charlie knows he will never see Ahmed or Amy again. He decides that he trusts Amy and therefore the Doctor.
Ahmed pulls up at the pipe bridge. He is afraid to drive across because of Sollogs. Slipstream orders him on and sure enough a Sollog soon blocks their path. Slipstream shoots at it, but misses, and it charges their buggy. Ahmed swerves but the impact of the Sollog knocks him out of the buggy and he rolls down the slope and clings on, holding on above the gorge. Slipstream gets into the driver's seat as Amy prepares to leap to Ahmed's aid. Slipstream orders her to sit and points the gun at her. The Sollog charges and as Slipstream shoots it (causing it to explode) Amy leaps out and runs to Ahmed. The pipe, weakened by Slipstream's earlier shot, crack. Ahmed falls into the abyss and Amy tumbles over the edge, grabbing hold at the last minute as the pipe swings into the side of the gorge. Above her Slipstream waves farewell and departs.
The Doctor climbs a gloomy staircase into a tower lit by torches and flickering fluorescent tubes. In a chamber lined with humanoid statues fashioned from scrap metal and hung with images of Gobo the clown he sees a large throne. He is knocked to the ground as Tuco announces Django. A tall, bearded man with long hair enters. Tuco denounces the Doctor as a heretic. The Doctor tries to talk about the comet but Django adds that the Sittuun who said the same thing were killed. He says that the comet is actually Gobo coming to take the humans to El Paso. He sentences the Doctor to death in the acid lake, Mono.
Amy finds herself clinging to a vine when a tiny craft flown by Charlie comes into the canyon. He pulls in close to her so that she can scramble aboard and then they land on the salt flats. Amy tells him that Ahmed is dead and that Slipstream abandoned them. Charlie replies that his father is going to take Slipstream's ship and set off the bomb. They have one hour to get to the human city and back out again.
Slipstream has crossed the swamp after driving off the Sollogs. The buggy is in bad condition and he knows it will get him to the human city but not back again. He reasons that he escaped from Volag-Noc and stole The Golden Bough so there will be a way out. He drives to the gates of the city where the guards promptly slash his tyres and grab him.
Charlie tells Amy that Beagle XXI is a European human ship but Amy can't understand why Jamal works for a company with human connections yet hates the race. Charlie adds that until first contact with humans the Sittuun had never been into space.
Slipstream is taken to Django. He tells the leader that he will reveal the Sittuun hiding place in exchange for access to the Gobo room at the top of the tower. He also demands a guide and Django agrees to send him with Manco.
Sancho leads the Doctor out from the city. The Doctor asks him if the tower is the dead centre of the world and Sancho agrees that it is. They arrive at a bubbling lake of toxic waste where the Doctor is led to the end of a jetty. Sancho tells him that he will die now.
Jamal is programming the bomb when Heeva enters to say that the human drums are getting louder. Charlie has gone and the captain is worried how he will break this news to his wife when he returns home. Heeva and Jamal have evidently begun a relationship since their ship crashed and she is aware that it must end when they leave. She wonders what life will be like for her if she survives and whether she will ever see Jamal again. Jamal tells her he can't leave without his son and asks for an extra thirty minutes. She wonders if they even have that long before the impact.
Amy and Charlie hide in a side street in the city, hardly able to believe that Amy could be so convincing when she told the guards that she was one of the humans and Charlie was her prisoner.
Back in the throne room the Doctor finds out from Tuco that he has been reprieved. Slipstream enters. The Doctor says that the last time they met was when the Doctor was putting Slipstream behind bars on Volag-Noc for the Belaform Diamond Heist when Slipstream crashed a passenger ship into a diamond repository on Belaform 9, killing seven hundred people. Slipstream curtly notes that the Doctor's face has changed since then. Manco is also present in the room. He is to be their guide into the Gobo room. Slipstream adds that it was he who sent the trans-temporal distress signal, knowing that the Doctor would inevitably answer it. Django interrupts, demanding to know where the Sittuun are hiding.
Amy sees soldiers gathering near to the city gates. She has arrived at the base of the spaceship. The comet is even closer now and fragments of it are already breaking off and crashing into the surface of Gyre, causing pieces of the city to collapse. A door opens nearby and Slipstream steps out, followed by the Doctor and dozens of humans. Three humans follow Slipstream and the Doctor through a door near the base of the ship.
Manco leads them while Tuco and Sancho act as their guards. Slipstream says he is looking for the hold so Manco leads them on. The Doctor reminisces that it is several regenerations since he had Slipstream incarcerated.
Django leads a party of a hundred humans across the desert. Most are on foot but several are riding bizarre contraptions powered by steam and levers.
The Doctor wonders how he can warn the Sittuun of the impending attack. His journey takes him through passages and up ladders and through a room filled with sleep pods containing the skeletons of the original crew. The wind howls and occasional crashes are heard outside. Slipstream says that he is after the Mymon Key. The Doctor tells Manco that the key is a source of limitless energy made on Mercutio 14 by the Hexion Geldmongers. It has the power to tear the universe apart. Endless wars were fought over it. Its power is derived from gravity.
Slipstream fills in more of the Key's history. The Geldmongers took it back and locked it in a casket that could only be opened by someone fluent in Hexion. When Mercutio 14 was destroyed and the Hexions were wiped out it was thought that the Key was lost forever. However, the casket had already been stolen and in the 31st century it was placed in a museum but later sold on. It was in transit when the ship carrying it crashed. The ship was the one they are standing in.
Slipstream says he read all of this when he was in prison in Volag-Noc's library. The Doctor says he can't believe that Slipstream sold out the Sittuun but Slipstream replies that the humans can't reach their prey since the only bridge collapsed.
They reach the control room which is full of dead screens. The Doctor uses his screwdriver to bring one console to life and dozens of wall screens light up. He presses a few keys and flicks switches. On the screens appear dozens of repeated images of Captain Zachary Velasquez. He says that The Herald of Nanking crashed and only five hundred of the three thousand crew survived. When he says that Earth is twenty five light years away Tuco denounces his words as heresy. Sancho realises that Gyre isn't Earth and asks what Gobocorp is and what is meant by a 'ship'. He tells Tuco that Django has lied to them. Tuco pushes Sancho over a walkway. Sancho plunges thirty feet and lands with a sickening thud. Slipstream orders Manco, Tuco and the Doctor to proceed. As the party leaves the room the Doctor, unseen, flicks one final switch.
Captain Jamal works out the controls to The Golden Bough. The only thing stopping him from leaving at once is the unsettling notion of fear. Just then Heeva calls to say that she has received a message in Morse code from the city. Someone in the tower is flashing a light. She reads the message: 'humans attacking' and says she will activate the bomb.
After crossing the salt flats the humans enter the marsh where they are surrounded by Sollogs. They are outnumbered until a fall of meteorites from the comet startles the Sollogs. Django thinks this is a miracle sent by Gobo to help them as the Sollogs scatter and hide. This is strengthened when they see the chasm with the broken bridge begin to collapse and fill with debris until there is only a shallow trench.
Meanwhile, the bomb is ticking down from sixty minutes.
In the cargo hold of The Herald of Nanking Slipstream has a book compiled by enthusiasts who tried to explain her disappearance. It lists passengers and cargo on the final voyage. They use the book to find a gleaming cobalt box deep within the cavernous room. The Doctor takes the box from Slipstream's hands and shakes it. He says the casket is broken and the key has been working the whole time. Slipstream asks if the Doctor can read the instructions. The Doctor says he can but he won't. Slipstream puts his gun to the Doctor's head.
Jamal starts the engines of The Golden Bough and orders Heeva to join him. She stops at the cargo doors of the Beagle and presses the control panel to lock the hold. Jamal tells her to hurry; the humans are almost upon them. She turns with a sad smile and tells him to leave without her. An arrow hits the control panel, causing it to explode. A second arrow hit Heeva in the chest. She falls to her knees as the humans surround her. The Golden Bough lifts off.
The Doctor solves the puzzle on the exterior of the casket that allows it to be opened. Inside is a block of quartz that holds a golden pebble - the Mymon Key. Slipstream says his first plan is to hold Sol 1 to ransom, threatening to turn the sun into a black hole unless he gets ten per cent of everything in the system. The Doctor says that the Gyre is the only flat debris pile in the universe. He wonders why that is and why The Herald of Nanking crashed in the first place. He suggests that such piles only form in the perfect convergence of a system's gravitational fields. As the key feeds on energy he suggests that the Gyre is its perfect home. Slipstream tells him not to be so sentimental.
The humans enter the cargo hold and find the bomb. Django says that it is the weapon of the Bad and must be taken back to the city.
As they leave the cargo hold Tuco says that it is sacrilege taking the treasure of Gobo. In response Slipstream shoots Tuco and turns his gun on the Doctor. Before he can fire, Charlie puts his gun to Slipstream's head. Charlie punches Slipstream who drops his gun which the Doctor tosses away. Amy throws her arms around the Doctor. As they step out from the ship they see the humans standing at the gate of the city, staring up at the comet which is huge above them.
A large fragment of comet crashes down near the humans, causing all but Django to cower. He keeps eye on the bomb's countdown. He doesn't know what the bomb will actually do, but he does know it is sent by the Bad. He knows from the teachings of the elders that the Comet is Gobo and its return will save them from the Bad. He knows also that he has the one person who can disarm the bomb - Manco.
Jamal fights to fly his ship in a straight line. He still feels fear, not for himself but for his son. He flies out of the Gyre's thin atmosphere and arcs back towards the city.
Manco leads the group into the chamber of stories. A cowboy film is playing, watched by an Elder who recites the story of Gobo over the actions. The Doctor uses his screwdriver to play the real soundtrack through the speakers so that the watchers can hear the real words. They are excited to hear the Olden Ones speaking. He tells them that they are watching The 8.10 to El Paso. He adds that it has nothing to do with Gobo and explains the true plotline of the movie. He explains that the film is fiction but the impending comet is real and implores them to leave the city. Despite this pleading none of the audience listens. Charlie pulls him away. The humans stay where they were.
Amy understands the Doctor's distress: there were children in the audience. A hundred metres from the city Manco declares that he is not coming. He says he belongs here and wouldn't fit in on the real Earth. The Doctor gives him the Key and says that it belongs there, too.
Fragments of comet fall around them and dodging between comes The Golden Bough. However, Jamal can't land: every time he approaches the ground the ship lurches upwards. Using speakers in the hull he tells them that the Gyre won't let him land. The Doctor signals for him to go up and the four others run across the salt plains towards Charlie's helipod. There they see countless Sollogs oozing into the salt. The Doctor says they have run in fear from the comet. They reach the helipod, Bird, Amy and Charlie climbing in and the Doctor and Slipstream clinging to the outside.
Charlie radios his father, arranging a rendezvous at the TARDIS. As they pass over the swamp a Sollog leaps onto the small craft. Charlie shakes the craft about, throwing the Sollog into the propellers but sending the two men tumbling from the outside. Amy screams. Then, seconds later, the Doctor climbs up across the nose of the craft, dragging Slipstream with him. One of the engines fails and the Bird plunges down. It crashes into the surface. Charlie and Amy emerge from the wreckage to find the Doctor crouched over an unconscious Slipstream. Charlie hauls him over his shoulder and they run to the TARDIS. They barely get inside before the valley around them is hit by a large fragment. They dematerialize as the valley vanishes in fire and debris.
Manco watches a fireball punch a hole in the face of Gobo before the entire ship keels over and crashes to the ground. One of Django's guards finds him in the dust cloud that results and tells him he is wanted.
The TARDIS lands inside the hold of The Golden Bough. There is an emotional reunion between Charlie and Jamal. They drag Slipstream into the hold. Jamal tries to pilot away from the Gyre but something drags them back down. They wake Slipstream (a slap from Charlie doing the trick) and the Doctor demands the real Mymon Key. Begrudgingly, Slipstream hands it over. The Doctor takes the TARDIS back to the Gyre and casts the key into the swamp.
While he is away Amy goes back to the ship's hold and is promptly taken prisoner by Slipstream who has one of the many guns he keeps there. He drags her into an escape pod which he jettisons. The Doctor, back at the TARDIS door, sees the pod's parachute and watches it land and the two occupants get out. Slipstream approaches, his gun at Amy's head, demanding the Key. The Doctor tells him it is in the swamp. Slipstream leaves Amy and wades into the swamp. He disappears from view but they hear the sound of his blaster and the screech of Sollogs. Then there is silence, followed by Slipstream's scream.
They return to the TARDIS and fly back to The Golden Bough. Jamal is pleased to see them and also to hear that Slipstream is dead. He turns the ship away from the Gyre.
With the city destroyed, Django's throne is now in the dungeon where Manco was kept prisoner. It seems appropriate to Manco that everything should end here. Django asks if he knows what the canister next to him is. Manco replies that it is the bomb. Django agrees, saying it is the work of the Bad and that Manco must deactivate it so that Gobo can save them. Manco shakes his head saying that the star with the green tail will destroy their world and many others. Django says that there are no other worlds but Manco believes the Doctor. He says that the Doctor is a good man who tried to save them all and it is Django who has condemned them to death. He reminds Django that he is a wordslinger and his chosen word is "No". Django flings himself at Manco in fury but Manco merely smiles as the bomb's timer reaches zero.
From a distance, to Amy's eyes, the explosion is a darkness that opens in the centre of the Gyre and spreads out until there is only a haze. The comet punches through the haze. The Doctor has refused to watch. Amy asks if he is OK and he replies that he is if she is.
The descendants of the crew of The Herald of Nankingare gone as is the last remnant of the creators of the Mymon Key. The Doctor reflects that time forgets all civilizations eventually. Jamal thanks him for saving them all but the Doctor tells him that it is Charlie who should be thanked. Jamal realises that the Doctor is thinking about the humans who died. Jamal, too, says that even though he saw the humans as murderous savages he still could not bring himself to set the bomb, knowing it would kill them all. This despite predictions that the impact of the comet meant his homeworld had a 98 per cent chance of being hit. He adds that the Doctor is a good man who did all that he could.
Charlie makes a romantic pass at Amy who is a little bit shocked and then amused. She kisses him once while he plays her his favourite Ella Fitzgerald song, Stairway to the Stars'. The Doctor enters and tells them that he once jammed on the recorder with Ella. It didn't go down well. He and Amy step into the TARDIS which vanishes.