1,894 years later...
In Leadworth 1996, Amelia Pond prays to Santa for him to come help her deal with the crack in her wall. She hears the wind blowing outside and goes to investigate, but there's nothing outside. She looks up at the sky, a sky with no stars.
Later, Amelia shows a painting of a star-filled sky to her aunt, Sharon, and her friend Christine. They take her outside and show her that there are no stars, and try to convince her that it's just a story. Back inside, Amelia tries to sleep but gets up and sees someone drop off a flyer. She runs downstairs and gets it, and discovers that it's a flyer for a museum. There is an advertisement for a new exhibit, the Pandorica, and a handwritten note inviting her to come.
The next day, Amelia convinces Sharon to take her to the museum. They pass by an exhibit of stone Daleks, which catch Amelia's attention briefly, but she finally locates the Pandorica exhibit. Someone snatches away her soda glass, distracting her, and when Amelia turns back to the Pandorica, she finds a note on the exhibit telling her to stick around. Amelia runs way and hides. When the museum closes, she goes back to the Pandorica and touches the huge stone box. It opens, revealing... her older self, who says this is where it becomes complicated.
1,894 years previously...
In England, Rory holds the dead Amy in his arms and wonders what will happen now that history has been altered. He begs her to laugh at his joke and hopes that he might get a ridiculous miracle. Suddenly the Doctor appears out of nowhere, wearing a fez and holding a mop. He tells Rory that Amy is dead, but she isn't, and that he needs to get him out of the Pandorica. The Doctor rambles on, gives Rory his sonic screwdriver, and tells him to just point and press, and leave the tool in Amy's top pocket when he's done.
Rory goes to the Pandorica and frees Doctor. The Doctor is surprised to see him and realizes that the sonic screwdriver Rory has is his own, but from a future point. He notices two petrified Daleks and several other aliens. Since the universe is collapsing, their histories have been eliminated and the remains are afterimages. Earth is at the eye of the storm and will be the last planet to go out. The Doctor then goes to see Amy and realizes she's dead. He tells Rory that he's a Nestene Auton, and his memories are software. The Doctor admits he can save Amy, but he doesn't have the time when he has to save the billions of lives that have been wiped from existence. Rory angrily hits the Doctor, who congratulates him on being human and overcoming the Nestene programming. They then take Amy downstairs and place her in the Pandorica, and the Doctor explains that the Nestenes took a memory print of her and got more than they expected. He leaves her a telepathic message and then seals the Pandorica, explaining that the box won't let its prisoner die as a means of escape. Now it needs her DNA to restore her.
In the present of 1996, Amy revives and emerges from the Pandorica. She explains that the Doctor is in her head and realizes that almost two millennia have passed.
In the past, the Doctor gets River's vortex manipulator and prepares to depart for the future. Rory prefers to stay there to guard Amy and the Pandorica, but the Doctor warns that he'll go insane. However, he admit that Amy will be safer with Rory there, and admires him for being human. The Doctor tells him to be careful of anything that could harm his new form, such as heat, and then departs for the future. Rory draws his sword and sits down.
In 1996, Amy listens to a museum tape about the legendary Centurion that always accompanied the Pandorica down through the ages. His last recorded appearance was during the London Blitz, carrying the box from the flames. Amy realizes that it's Rory. Suddenly one of the petrified Daleks comes back to life and advances on them. The Doctor arrives via the time manipulator and gets Amy and Amelia away while the Dalek discovers that its weapon systems are now inactive. The Doctor takes a fez from an exhibit and dons it. A guard enters the chamber and the Dalek concludes that it is unarmed and harmless. However, the guard's hand opens, revealing a handgun. The newcomer shoots it at the Dalek, destroying its eyestalk, and steps forward to reveal that he's Rory. The Doctor shuts it down while Amy and Rory embrace. He apologizes for killing her but she kisses him. Rory explains that he waited 2,000 years for him. Amelia asks the doctor for a drink and the Doctor realizes that the light from the Pandorica activates the Dalek... and it's doing it again.
Everyone runs out of the exhibit room and the Doctor seals the door. He grabs a mop and Rory realizes he now looks like how he did 2,000 years ago. The Doctor quickly goes back in time and gives Rory the sonic screwdriver and explanations to free him from the Pandorica. In the present, the Doctor then takes the sonic screwdriver from Amy's pocket. Finally, he realizes that he left Amelia the notes to come there, grabs the necessary material, and travels back to make sure Amelia gets everything she needs to. As they start to go, a Doctor from the future appears at the top of the stairs and collapses. The Doctor confirms that it is really him. His future self wakes up, whispers something to him, and then collapses, dead. Seemingly unconcerned, the Doctor realizes that he has 12 minutes to live and tells them to come along. When Rory objects, the Doctor points out that Amelia has disappeared because she's been wiped from history. The eye of the storm is closing and they are anomalies, but time is running out. As they leave, the Dalek behind them revives in the light of the Pandorica.
The Doctor, Amy, and Rory emerge on the roof as the sun rises as time shrinks. The Doctor grabs the rooftop satellite dish and points to a burning sphere in the sky. He realizes that it's the exploding TARDIS and uses the satellite dish to amplify its distinctive noise. Rory says that there's a voice that he can hear because of his Nestene voice. The Doctor amplifies it and they realize that it's River, saying that she's sorry over and over. The TARDIS has put River into a time loop to save her, but she's at the heart of the explosion.
In the TARDIS, River tries to stop the explosion and escape over... and over... and over. Finally the Doctor appears before her and uses the time manipulator to get her out of the loop and back to the museum rooftop. The first thing she does is destroy the fez with Amy's help. The Dalek hovers up to the rooftop and they flee down through the roof hatch. The Doctor figures they have four and a half minutes until it has enough power to kill him: just the time in twelve minutes that he is destined to die. As they go downstairs, the Doctor tries to figure out how the Pandorica brought back the Dalek when the Daleks never existed. He realizes that the Pandorica holds the atoms of the universe before history was changed, and suggests that they can use one of those atoms to recreate the universe. Now they have to reboot the universe, but they will need to transmit the light of the Pandorica to every point in space and time. All they need is one spark to create a new Big Bang. The Dalek arrives and kills the Doctor, and Rory manages to destroy it. The Doctor, dying, activates the time manipulator to go back 12 minutes in time.
The Dalek reactivates again and River tells them to go on. She warns it that its shield density is compromised, and she prepares to shot. It suggests that as a companion of the Doctor, she will show it mercy. River tells it who she is, and the Dalek begs for mercy.
Rory and Amy discover that the Doctor's corpse has disappeared. River arrives and tells them that the Doctor lied when he said that his future self has died. They run to the Pandorica and discover the Doctor inside. Amy realizes that they were a diversion so that the Dalek would chase them while he worked with the Pandorica. Up in the sky, the TARDIS explosion speeds up. They look through the museum and realize that the exhibits are disappearing as time is wiped out. The Doctor mutters about the Big Bang and River realizes that the TARDIS is exploding at every point in history. If they toss the Pandorica into the explosion, its light will appear everywhere at well as the TARDIS explosion provides the necessary power. The Doctor wired the vortex manipulator into the Pandorica, and River realizes he's going to fly it into the heart of the explosion.
As they wait, Rory wonders if Amy is okay. She snaps at him and then they embrace. River tells Amy that the Doctor wants to talk to her, and Amy wonders what will happen. The cracks in time will close and they will all be back where they should be, but the Doctor's existence will be purged from the universe's memory. Amy goes to the Doctor, who asks if he was worth waiting for her when she was a child. He admits that he took her with him because the house was too big, and there was no sign of anyone else living in the house. Amy doesn't remember what happened to her parents, and he tells her that it's not her fault. The crack in time ate away at her life for a long time, and he couldn't resist the puzzle she represented. She promises not to forget. The explosion accelerates and the Doctor tells Amy that the universe poured into her head and she has the power to bring back her parents just like she brought back Rory. The Doctor activates the Pandorica and seals the doors, and then it shoots out through the ceiling and into the explosion. He sends one final message: "Geronimo."
The Pandorica shoots into the explosion as it reaches its peak. Time rewinds and the Doctor finds himself in the TARDIS, alone. He looks around and discovers that he's seeing himself and Rory a week ago. His timestream is unraveling and he will soon be gone. he calls out to the past Amy, who seems vaguely aware that he is there.
The Doctor finds himself in Aickland Road and sees Amy leaving a message for Craig. She can hear him but not see him, and there's another crack nearby.
Time rewinds further and the Doctor finds himself in the forest aboard the Byzantium
. Amy is there, keeping her eyes closed to resist the Angels. The Doctor goes to see her while his past self is occupied, and tells her that she has to remember.
The Doctor finds himself at Amelia's house on the night where she waited for him. Going outside, the Doctor finds Amelia asleep by the garden and takes her inside to her bed. He assures her that when she wakes up, she'll have a mother and father and he'll only be a story in her head. As he fades out, the cracks close and the Doctor realizes that they can't close properly until he's on the other side. Rather than go through the rest of the rewind, he kisses Amelia on the forehead and then enters the crack. Amelia wakes up and looks at her bedroom wall... where the crack has disappeared. Outside, the sky is filled with stars.
Years later, Amy wakes up on her wedding day and looks at her dress. Her mother Tabetha comes in with breakfast and Amy is surprised to see her. She tells Amy to be downstairs in ten minutes, while Amy tries to figure out why she's surprised that she has a mother. Her father Augustus is waiting for her and Amy hugs her, and Tabetha wonders why she's acting like she's never seen her before. She calls Rory and admits shes forgetting something, but can't remember what. He doesn't remember anything.
At the wedding reception, Amy and the others are celebrating when she notices River outside and seems to recognize her. Rory notices that she's crying, and Amy admits she doesn't know why. He suggests it's because she's happy he's married, but Amy says that she's sad. Rory isn't happy to hear that. Amy notices a blue book on the table and Rory says the woman left it for her, but Amy discovers that the pages are blank. Rory reminds her of the wedding saying, and Augustus gets up give the toast. Amy sees guests with bow ties and suspenders, and sheds a single tear that falls on the book.
Amy gets up and tells Augustus to shut up, and then insists that someone important is missing. Amy says that when she was a child, she had an imaginary friend, the Raggedy Man, but he was real. She says that she remembers the Raggedy Man and if she can bring everyone else back, she can bring him back. The room begins to vibrate and a vast roaring noise fills the room. The TARDIS materializes in the middle of the room and Rory remembers the Doctor and the fact that he was plastic. Amy goes to the TARDIS door and greets the Doctor, who is wearing a tuxedo. He introduces himself to everyone as Amy's imaginary friend.
The Doctor joins in the celebration, dancing with the children. He watches as Amy and Rory dance. Later, he goes to the TARDIS in Amy's garden, and finds River waiting for him. He gives her the journal back and admits that he didn't peak. The Doctor asks if he's married and she wonders if he's asking, and manages to duck the question of whether they are married. When he asks who she really is, River says that he'll find out soon... and that's when everything changes. She disappears in a flash of light and the Doctor goes back inside the TARDIS. Amy comes in after him and Rory comes after her. Rory suggests the Doctor take a day off, but the Doctor warns that something drew the TARDIS there and caused the explosion, and it's still out there. The phone rings and the Doctor gets word of an Egyptian goddess on the loose on the Orient Express in space. He says to Rory and Amy that it's time to say goodbye, and they agree. Amy then goes out and says goodbye to her guests, and the Doctor assures Her Majesty that they're on their way.