Rory drive's his Mini erratically through a wheat field with Amy in the passenger seat shouting intricate instructions. They screech to a halt in front of the TARDIS with the Doctor brandishing a newspaper - the Leadworth Chronicle. It shows an aerial photograph on the front page of the crop circles they have just made, spelling out the word "doctor". Rory tells him this is because he never picks up his phone. Rory notices a line through the word that they did not make. Another car drives across the field towards them and the Doctor dives out of its way. It halts suddenly and Amy and Rory's friend Mels gets out. She is delighted to see the TARDIS at last and knows who the Doctor is. As police sirens are heard she produces a gun and tells the Doctor she needs to get away. She suggests they us the TARDIS and the gun to kill Hitler.
In a montage of shots, Mels repeatedly gets into trouble: at primary school for insulting a teacher because she has never heard of the Doctor; at secondary school for the same thing; in a police station for stealing a bus. Finally, in Amy's bedroom, she manages to point out to Amy that Rory has not got a girlfriend because he loves Amy and not (as Amy has assumed) because he is gay.
The TARDIS spins, out of control, through the sky. Mels has shot the console to test out the "clever lie" that weapons don't work in there because the TARDIS is in a state of temporal grace.
In 1938 Berlin, a Nazi officer, Erich Zimmerman, enters his office, watched by a workman wearing overalls. Inside the workman is a crew of tiny people who gather data on the officer's appearance. One of the tiny crew makes her way to the eyeball and looks out because she doesn't trust the sensors (they "made Rasputin green" apparently). On the way she has to update her privileges on a wristband to prevent the anti-bodies (robotic jellyfish in appearance) from killing her. The workman (actually the Teselecta) assumes the shape and size of Zimmerman who is shrunk and beamed aboard where he is left to the antibodies to be exterminated.
The Teselecta enters Hitler's office and begins the process of sentencing and punishing him for his war crimes. However, one of them points out that it is 1938 and too early in his time stream; they need to return later.
The TARDIS crashes in through the window. Hitler dives under his desk and the Teselecta is knocked out. The Doctor staggers out of the TARDIS, followed by the other three. He tells them not to re-enter because of a cloud of toxic smoke caused by Mels having shot the console. Hitler thanks them for saving his life and asks what the blue box is. The Doctor says it is a police box from London and "The British are coming." The Teselecta stands up and Hitler produces a gun and fires at it several times. Rory punches him and then, on the Doctor's instructions, locks him in a cupboard. The bullets missed the Teselecta but hit Mels in the stomach. The Teselecta scans the TARDIS and says that they have found an even bigger war criminal than Hitler.
Mels reveals that she is Melody Pond (apparently Amy named her daughter after her best friend who was her daughter all along) and regenerates into the woman they know as River Song. She runs around excitedly checking out her new body while the crew of the Teselecta confirm that they have got the woman who kills the Doctor in their clutches. River produces a gun and tries to shoot the Doctor but he had previously removed the bullets. She pulls another gun, only to find he has swapped it for a banana. As she produces a knife and another gun (both proving futile) she explains that she was programmed for this assassination when she was a child. Eventually she seems to relent and kisses the Doctor before exiting through the window to go shopping. As she leaves she reveals that this was her actual method of execution. The Doctor collapses, dying, and the Teselecta scan reveals to its crew that he has been poisoned. The Doctor tells Amy and Rory to go after her. They arrive at ground level as a party of six soldiers shoot her but River uses her regenerative energy to knock them down and, laughing, steals their guns and a motorcycle.
The Teselecta arrives on a motorbike and Amy and Rory knock it off and steal the bike. Rory says he expects he will be able to ride the bike because it is that sort of day. The Teselecta changes form to incorporate a motorbike and sets off in pursuit. Its crew wonder how the Doctor can die here and now when the records show that his death is known to be at Lake Silencio in 2011.
The Doctor falls into the TARDIS and asks for a voice interface. It appears first in the form of a hologram of the Doctor. He asks for someone that he likes instead and it changes to Rose Tyler, Martha Jones and Donna Noble. He rejects each because of the guilt he feels at seeing them. Finally, it becomes young Amelia Pond. The Doctor tries to get it to help him but it replies that he has been poisoned and has 32 minutes to live. It adds that the poison came from the Judas Tree, there is no cure and that regeneration is impossible. He pleads for something to inspire him and it mentions "Fish fingers and custard." He laughs and drags himself over to the console.
Melody arrives at a restaurant and threatens the diners with a machine gun. She steals all of their clothes and sends them out. Amy and Rory arrive, followed by the Teselecta, which has now assumed the form of Amy. The Teselecta enters and accuses her of killing the Doctor on the orders of the movement known as The Silence and the Academy of the Question.
Amy and Rory find themselves inside the Teselecta. the antibodies threaten them but one of the crew gives them wristbands and tells them that they are aboard Justice Department Vehicle 6018.
The TARDIS arrives in the restaurant and the Doctor steps out in top hat and tails. He uses a sonic cane to deduce that the Teselecta is a justice machine with 423 people miniaturised to fit inside. Amy sends him a signal, using the sonic screwdriver, to show that she and Rory are in there, too. The Teselecta explains that it travels to criminals near the ends of their lives in order to "give them hell." By this it means that they are put into a state of perpetual pain. As a demonstration it envelopes River in an energy field and tortures her. The Doctor, now collapsed due to kidney failure, begs them to stop. The Teselecta says that time travel has responsibilities; the Doctor retorts that going back to torture dead people doesn't seem very productive.
The Doctor demands to know who arranged his death. Amy tells the Teselecta captain that the Doctor is her best friend and that River is her daughter. She says she has a right to know what is happening. She is given access to the records department and tells the Doctor that the Silence, a religious movement, believe "silence will fall" when the Oldest Question in the Universe is asked. It says that Question is hidden in plain sight but does not know what the Question actually is.
The Doctor pleads with Amy to stop the Teselecta torturing River. She uses the sonic screwdriver to destroy the crew's security clearance wristbands, provoking the antibodies into an attack. The captain asks the mother ship to teleport to them away, leaving only Amy and Rory aboard. The Doctor, with only three minutes to live, begs River to save her parents. She is impressed by the fact that he still cares about others in his last moments and demands to know who 'River' is.
Amy and Rory embrace as the antibodies close in on them but the TARDIS materialises around them. They look to see the Doctor but find it is River who has flown the TARDIS. She says that the Doctor told her she is the child of the TARDIS and the TARDIS taught her how to fly it. They go back into the restaurant and find the Doctor in his last moment. He tells Amy and Rory that there is no way for him to survive. He asks to speak to Melody and tells her to find River Song. He whispers something in her ear and she replies that she is sure "she already knows". The Doctor's consciousness fades and she asks Amy who River Song is. Amy asks the Teselecta to show them River Song and it changes form to become River. Melody asks her parents if the Doctor is "worth it". They say she is and River kisses the Doctor, passing her regenerative energy into him.
This obviously has a debilitating effect for she wakes up in a hospital bed. Amy tells her that she shouldn't have used up all of her remaining regenerations to save the Doctor, whereas he gives her the diary that she will use later to keep track of their meetings.
In the TARDIS, the Doctor looks at some information he downloaded from the Teselecta: the day of his death. He keeps this hidden from Amy, saying only that he has left River in the best hospital in the universe in the care of The Sisters of the Infinite Schism and that one day River will find her way back to them. Amy asks how River will do this.
River applies for a degree in Archaeology at the Luna University in 5123. When the professor asks her why she wants to do this she replies that she is "looking for a good man."