On Demon's Run, two Clerics (the Fat Man and the Thin Man) pass Lorna Bucket, another soldier. They are talking about the Doctor destroying the Cyber Legion and the time he drove the Atraxi from the Earth. They ask Lorna about her encounter with the Doctor. The Fat Man leaves with three Headless monks to complete a conversion tutorial. The Thin Man stays with Lorna, to talk about the Doctor. She says she met him when she was a young girl in the Gamma Forest, and he told her to run. The Fat Man is brought to the Headless Monks' headquarters and is asked to make a donation. The Monks advance on him with an empty box. He realises that they are going to take his head.
In Victorian London, a hooded figure returns home. She tells her maid, Jenny, that she has just defeated Jack the Ripper, and eaten him. She is the Silurian woman, Madame Vastra. Jenny shows Vastra to the drawing room, where the TARDIS waits. Vastra says that a very old debt is about to be repaid. She tells Jenny to pack the swords.
In the Battle of Zaruthstra in 4037, Commander Harcourt needs a nurse to tend the son of the President. A Sontaran, Commander Strax, enters and tends the wounded boy. As he leaves, Strax says that he was made a nurse as a penance. He hears the TARDIS nearby and says that his penance may be finished.
River Song returns to Storm Cage Containment Facility. She has been on a birthday outing with the Doctor. Rory steps out of the shadows, still in his centurion outfit. Rory tells River the Doctor needs her and that she must come with him. River checks her diary and calculates that it is the Battle of Demon's Run. She says that she can't be there until the very end. She tells Rory that this is the day when the Doctor will rise higher than ever before, and then fall so much further. It is also the day when he finally finds out who she is.
Dorium Maldovar, entrepreneur and bar owner of the Maldovarium, is packing to leave. Madame Kovarian and Colonel Manton stop by to interrogate him. They say that they have already waited a month and the Doctor has done nothing. Dorium tells them that the Doctor is raising an army of people who owe him a debt. He also knows that the Clerics and the Headless Monks are based on an asteroid called Demons Run and adds that the name comes from an old saying: "Demons run when a good man goes to war." Kovarian and Manton leave, thinking that there is nothing to be learned. As soon as they have gone, the TARDIS materialises. Dorium is horrified to realise that he has been recruited, too. He protests that he is old, fat and blue.
At Demon's Run, Colonel Manton makes a speech to the military, both Clerics and Monks. He tells them that the Doctor is just a man and they must not believe the stories they've heard. Amy watches all of this from her room, above. Lorna comes in to give her the prayer leaf she has sewn with Melody's name in the language of her people. Amy initially ignores the offer until she realizes that Lorna has met the Doctor. S takes the leaf but tells Lorna to be on the right side when the Doctor arrives.
Lorna arrives at the speech as Manton is telling the Clerics that he has received a dispensation from the Papal mainframe that will allow him to lower the hoods of the monks so that they can see why the monks are invincible. As he lowers the third hood, the monk is revealed as the Doctor. The Monks brandish their swords and the Clerics raise their guns at him. Up in the control room above, Vastra and Jenny overpower two guards and turn off the lights in the hangar. The Doctor puts his hood on and tells Amy to get her coat. The lights come back on and the soldiers look at the Monks to see which the Doctor is. One of the Clerics panics and shoots a Monk. The Monks retaliate and a battle seems about to begin.
Colonel Manton orders the Clerics not to fire as he removes his weapon pack and drops his gun. The other Clerics do the same. Lorna sees a Monk using a sonic screwdriver to unlock a door and follows him. An army of Silurians and Judoon materialise on the walkways and hangar floor. The Clerics realise they are beaten. Commander Strax appears and holds a gun to Manton, telling him that Demon's Run is taken. Manton says that he will call in the fleet but the Doctor has a squadron of Spitfires attack the communications array.
Kovarian escapes towards her ship, accompanied by two Clerics carrying Melody in a cot. Kovarian sends the Clerics back to the hangar, telling them that it is important the Doctor thinks he is winning until the trap closes. Lorna overhears all of this from the shadows. She runs away but Rory appears and confronts Kovarian. She asks him how he plans to take her ship with twenty of her crew aboard but the doors open and Henry Avery and his son, Toby, appear: the ship is theirs.
Kovarian and Manton are taken to the Doctor in the control room. The Doctor tells Manton to order his men to run away; he wants Manton to be made infamous for those words and known as Captain Runaway for the rest of his life. The Doctor is angry and doesn't want anyone to use his friends to get to him again. Rory brings Melody to Amy in her room. Their tearful reunion is interrupted by the Doctor and meets Melody; the Doctor reveals that he can speak baby. Madame Vastra comes in to say that the Judoon have departed with the Clerics. It is only when she announces that the Doctor has never risen higher that Rory remembers River's words.
The victors gather in the hangar. Amy says that Melody is crying because the TARDIS noise bothers her. They discuss whether she needs feeding or changing but the Doctor brings a cot from the TARDIS , saying the baby is tired. Rory and Amy wonder why Amy was kidnapped and why the Clerics and Madame Kovarian wanted possession of Melody. Amy asks the Doctor what he thinks is happening, but he changes the subject and tells her that the cot was his. He goes to the control room where Dorium has gained access to Kovarian's computer files. He finds some scans of Melody's DNA, which show traces of Time Lord DNA. Vastra wonders where and when Melody was conceived. She knows that Time Lords only achieved their status through exposure to the time vortex and the Untempered Schism. the Doctor recalls that the first time Amy and Rory were together on the TARDIS after he rebooted the universe was on their wedding night. He thinks back to Amy's worries that her baby would have a 'time head'. Vastra suggests that Kovarian wants Melody as a weapon. The Doctor wonders why a Time Lord would be a weapon but Vastra reminds him of the things he has done. Dorium reflects that the Clerics' were beaten too easily and that something is wrong. The Doctor reconsiders what he has learned: the little girl from 1969 America with super-human strength, enough to escape from the astronaut suit. Kovarian appears on a screen in the control room. She tells the Doctor that Melody is "hope" in their war against the Doctor.
Back in the hangar, Lorna is brought in at gunpoint by Strax. She warns the group that she overheard Kovarian talking of a trap. They say that this is what they would expect a Cleric to say but she tells them she only joined the Clerics to meet the Doctor. She calls him "great warrior." Amy says that the Doctor is not a warrior, so Lorna asks why he is called "the Doctor" in that case. The lights in the hangar go off. Strax checks for life forms in the base other than the group around him and the Silurians: the result is negative. However, Lorna says the Headless Monks aren't alive and won't register. The Monks attack the Silurians and a force field surrounds the TARDIS as the doors in the hangar begin to lock. Dorium identifies the Monks' chant as "the attack prayer". He goes forward to greet them, saying that the Monks know him of old but he is beheaded. His headless body joins the Monks as they close in on the Doctor's friends. Rory leads Amy and Melody away into the shadows behind some crates and then joins the others as the battle begins.
The Doctor, up in the control room, tells Kovarian that Melody is not a weapon and he will never let her near Melody again. Kovarian drily replies that fooling him once was "a joy," but fooling him "twice in the same way - it is a privilege". He rushes off to Amy.
As the fighting goes on, Melody sees a hatch open, apparently in mid-air, and Kovarian whispering "Wakey wakey." Melody dissolves into Flesh, and Amy screams Rory's name. The Doctor arrives after the battle is ended and Rory says that they know Melody is Flesh. The Headless Monks have lost or withdrawn, Lorna and Strax have been mortally wounded. Strax informs Rory that dying is not the pleasure he thought it would be but he reflects on a long life - after all, he is twelve. The Doctor tries to give some comfort to Amy but she is too distraught to have anything to do with him. Vastra takes him, instead, to Lorna. She says that they met before but she does not think he will remember her. The Doctor lies, saying he remembers everyone and that they ran together. He asks Vastra who she was. The Silurian cannot tell him but remarks that she was very brave.
The Doctor, dejected, comments that they were always brave. He turns to leave but River Song appears in the hangar. The Doctor wants to know why she did not come earlier, when he asked her. River says that she could not have prevented any of it happening the way it did but suggests that the Doctor could. She asks if this is how he imagined events would unfold when he first set out on his journeys: a man who could turn an army around at the mention of his name. She points out that the word 'Doctor' means 'healer' or 'wise man' in much of the universe but 'great warrior' in the language of the Gamma Forest. The Doctor demands to know for once and for all who she is. She says that she is telling him now and glances at his cot. He reads the Gallifreyan carving and his face changes to delight. He looks with amusement at Amy and Rory before abruptly entering the TARDIS. He calls back to Amy to say that Melody is safe and then takes off.
Amy picks up a pistol and points it at River, demanding to know what she said to the Doctor. River hand the prayer leaf to her that Lorna sewed, which was in the cot. She says it is Melody's name in the language of the people of the Gamma Forest but they don't have a word for "Pond," because "the only water in the forest is the river." The TARDIS translation matrix gradually takes effect and the stitching on the prayer leaf changes from Melody Pond to River Song. River smiles, saying that she is their daughter. Amy and Rory gaze at her in disbelief.