NOTE: This spoiler was sent in by Andrea.

The movie opens with an animated story sequence narrated by Nim (Abigail Breslin).  The story is like a children’s book, and it explains how her mother, a marine biologist, died when Nim was a baby.  Her mother was studying a whale when a tourist cruise ship named “The Buccaneer” came too close and scared the whale.  The whale dove, taking Nim’s mother with it.  Nim’s father, Jack (Gerard Butler), also a marine biologist, sailed around the world with Nim, looking for her mother, but they never found her.  Eventually they ended up on an island where they built a home.  They live alone on the island, and the only visitors are a supply ship that occasionally brings them materials.  Jack corresponds with other scientists via email, and an article written by him about living in the shadow of a volcano was published in National Geographic.

Nim is now 11 years old, Jack home schools her, and she helps him with his scientific studies.  Her friends are animals on the island: Selkie, a sea lion; Fred, an iguana; Galileo, a pelican; and Chica, a sea turtle.  When the supply ship arrives, it brings a novel for Nim from her favorite author, Alex Rover, named “My Arabian Adventure.”  Alex Rover has written a series of best-selling novels about dangerous and exciting adventures around the world.  As Nim reads the book, the movie goes into a fantasy sequence in which Alex Rover (also played by Gerard Butler), who has been captured in the desert, fights off his enemies and escapes.  Nim thinks that Alex Rover is a great hero.

The real Alex Rover, full name Alexandra (played by Jodie Foster), is a writer living in San Francisco.  Real Alex is afraid of spiders, germs, and leaving her apartment.  The only thing she eats is canned Progresso soup.  She is currently experiencing writer’s block.  Fictional Alex (still played by Gerard Butler) is about to be sacrificed by being thrown into the boiling lava of a volcano, and Real Alex can’t find a way to have him escape.  Fictional Alex appears to Real Alex and tells her to either kill him off or find a way to save him.  He tells her she needs to get out into the world and experience life, but she is too afraid to go outside.  As she is surfing the web trying to find inspiration, she finds the article Jack had written about living next to a volcano, so she emails him.

Meanwhile, Jack is getting his sailboat ready, and he tells Nim that they have to go to a certain spot on the ocean for two days to collect protozoa.  He has promised to name one after her when he discovers a new species, and he thinks that they can find it.  Nim wants to stay on the island because Chica has laid her eggs, and they are about to hatch.  She convinces her dad that she can take care of herself for.  They can talk by satellite phone while he is gone.  He tells her to tell people who email that he will be back by Thursday.

Nim is fine taking care of herself.  We see her dancing around with Selkie and Fred, and she fixes herself dinner.  Before she goes to bed, she sees Alex’s email, and she becomes very excited that her hero has written.  She writes that Jack is not there, but that Nim also lives on the island with the volcano.

Alex reads the message and writes back, thinking that Nim is Jack’s research assistant.

That night Jack is collecting samples from the water, and he thinks he might have found the protozoan he will name after Nim.  As he is labeling the sample, the wind starts picking up, and a storm breaks out. 

On the island, Nim is inside the house when the storm begins to blow.  She tries to close all of the windows, but the wind rushes through, swirling papers and rain.  Nim huddles with Selkie through the night. 

The next morning, Nim fixes the solar panels on the roof and tries to reach her dad on the phone, but there is no answer.  She’s a little worried, but she knows that Jack isn’t due back for another day yet, so she isn’t panicked.  What she doesn’t know is that Jack’s satellite is at the bottom of the ocean, and his boat has sprung a leak.  He wakes up in the cabin of his boat, in a couple of inches of water.  He sets about trying to make repairs, but the mast of the boat is broken.  Galileo, the pelican, shows up and helps Jack out by catching some fish for him to eat.

Nim sets about to do some research for Alex Rover, so she climbs up to the top of the volcano to look inside the pit.  The surface is solid when she looks down.  She is preparing to descend, when she looks out over the water and sees a ship.  Through her telescope, she reads the name “The Buccaneer” on the prow.  A small rowboat with three sailors sets off from the ship to land on the beach.  Remembering that her dad had told her “The Buccaneer” had caused her mother’s death, Nim quickly scrambles down the mountain.  In the process, she scrapes her leg.  She gets down on the beach and spies on the people from the ship.  They are talking about setting up a resort for tourists on the island.  Nim vows to defend her island from invasion.

Nim writes to Alex to tell her about the volcano.  She also asks Alex what she should do about the cut on her leg, which has started to become infected.  In San Francisco, Alex looks in a Medical Encyclopedia and tells Nim that she should keep the cut clean and dry. 

Nim makes preparations to defend her island from the tourist ship.  She is building sling shots when Galileo flies in and steals a tool belt.  He drops it onto Jack’s boat to help him with repairs.  Jack starts building a propeller to power the boat.

Alex is starting to realize that Nim is not Jack’s research assistant, and she writes to ask her how old she is and if she is there alone on the island.  Nim tells her that she is only 11 and she is alone until her dad comes back.  She has been getting more and more worried since she still hasn't heard from her dad.  Alex tries to get help for Nim from her apartment, first by calling 911 (the dispatcher tells her that they only cover San Francisco, not an island in the middle of the ocean), and then by contacting someone in Fiji.  She can’t get anyone, so she asks Nim how she can help her.  Nim asks Alex to come to the island.  She gives Alex the coordinates for the island but tells her not to tell anyone else in order to keep the island a secret.  Alex writes back saying that she can’t come because she isn’t a hero, and that in fact she is an agoraphobic who hasn’t left her apartment for months.  Nim is confused since she still thinks that Alex is Fictional Alex Rover, a man who is a great adventurer.

Fictional Alex appears to Real Alex again, telling her to go find Nim.  The two Alexes argue, Fictional Alex telling her to be the hero of her own life story, and that a little girl is all alone on an island waiting for Alex to rescue her.

Alex packs her suitcase with bottles of Purell (hand sanitizer) and cans of Progresso soup.  Fictional Alex has to drag her out the door to make her leave the apartment and get into the taxi.  At the airport, security confiscates Alex’s can opener and bottles of Purell.  On the plane, Alex is nervous and obviously has been irritating both her seat companion and the flight attendant.  She takes a pill and passes out until the plane lands in Borneo, where the flight attendant wakes her up and she has to rush to catch her transfer, which turns out to be a very small plane.

In a village, Alex tries to find someone who will help her get to the coordinates that Nim gave her.  People are crowding around her trying to sell her things, and a man gets her into his taxi, telling her, “Come with me, I know where you want to go.”  He keeps repeating this phrase as he drives off.  She begins to realize that it is the only English he knows, and she worries that he doesn’t know where he is going, but eventually they end up at a place with boats.  A man in a motor boat takes her to an island where there is a helicopter that will fly her to Nim’s island.  But the boat drops her off a few hundred yards offshore, and she has to wade through the water to get to the beach.  Fictional Alex rejoices in the adventure, but Real Alex is upset and annoyed that Fictional Alex is having such a good time.

On the island, “The Buccaneer” arrives.  The tourists are put into small rowboats to take them ashore.  Nim sends Selkie out to swim past the boats, leaving a trail of foul smelling gas, but it doesn’t deter them from coming ashore.  They set up on the beach with beach chairs and umbrellas and games.

Nim is watching from a tree, when she drops her telescope.  An Australian boy from the ship is exploring through the trees and Nim is afraid that he might find the telescope.  Fred, the iguana, drops on the boy, sending him running back to the beach.  Nim picks up her telescope and sets her plan in motion.  She loads the sling shots with numerous iguanas and sends them flying onto the beach.  At first the tourists scream and run from the flying lizards, but the crew eventually drive the lizards away with torches.  Nim then climbs up the volcano and sets a fire so that it looks like the volcano is erupting.  She begins pushing boulders down the mountain, but she accidentally pushes one into the pit of the volcano, and it begins erupting for real. 

Ash spumes out of the volcano, and the tourists flee for the boats to take them back to the cruise ship.  Nim races down the mountain, but the Australian boy sees her and confronts her.  Nim is surprised to finally meet a stranger.  She says that he isn’t the way she imagined he would be.  The boy’s parents are calling for him, and he tells her that they have to leave, that the island is dangerous.  She replies that it isn’t dangerous to her because she lives there.  He finally runs to his parents, and they get in a boat and are rowing for the cruise ship.  He looks back and sees Nim watching them leave.

As night falls, another storm starts to pick up.  Jack’s propeller gets blown apart by the wind, and he is clinging to the sinking boat.  He sees a whale swim by, and thinking that it is the whale that swallowed Nim’s mother, he swears to her that he will get back to Nim. 

Alex is in the helicopter, and both she and the pilot are freaking out over the storm.  Even Fictional Alex thinks that they’re going to die.  The pilot spots “The Buccaneer” and says that they have to land on the ship.  The crew is not very happy about the helicopter landing on the ship, and they think Alex is crazy since she’s babbling about a girl alone on some island.  The captain tells her that the only island nearby is uninhabitable.  He talks with his crew about getting the ship’s doctor to restrain Alex.  The Australian boy overhears Alex, and he tells her that she isn’t crazy; he’s seen the girl on the island and she is real.  Alex thanks him and sneaks off.  With the crew chasing her, she gets into one of the row boats and drops it onto the water.  She begins rowing toward the island, but the waves overturn the boat.

Nim sees the rowboat from the island, and thinking that it might be Jack, she swims out with the help of Selkie.  She sees Alex and saves her from drowning.  The two of them wash up onto the beach, exhausted.

When they regain consciousness the next morning, Nim asks Alex who she is.  Alex tells her that she’s Alex Rover.  Nim doesn’t believe her at first, saying that Alex is a hero who wouldn’t need saving.  She realizes that Alex is telling the truth and can't help her dad.  She angrily tells Alex to leave the island.  Nim runs off into the trees, leaving Alex alone on the beach.  Fictional Alex tells her to follow the girl, but Real Alex refuses.  She says she should have stayed in her apartment.  Fictional Alex tells her that she is like Nim, alone in the world.  Real Alex says that she has him.  He decides that she doesn’t need him any longer, and he’s quitting.  He tells her goodbye and dives into the ocean.

Alex follows Nim’s trail into the woods, and she’s wandering around muttering to herself about how she took a plane and a helicopter, and she stole a boat.  She calls out for Nim, who is watching her.  Alex screams when she is surprised by a lizard and runs into a tree.  Nim comes to get her.  They go back to the house, and Nim cooks them dinner, including a dish made of meal worms.  Alex is grossed out, but she eats it

The next morning Alex wakes up to Selkie’s nose in her face.  She goes outside to find Nim.  Nim is sitting outside, looking over the ocean, her face sad and lonely.  Alex asks her how long her dad has been gone, and Nim replies that he’s been gone four days.  Nim thinks that he’s dead because otherwise he would have found a way to come home.  Alex tries to comfort her.  She says that no matter what happens, Nim won’t be alone because Alex will stay with her.

They look up when they hear Galileo come flying in.  Out on the water is a small craft.  It is Jack, who has rigged up two pontoons and a makeshift sail out of the wreckage from his boat.  He comes sailing up to the beach as Nim and Alex run out to meet him.  Nim and Jack hug as he says he missed her but he was determined to come back to her.  He sees Alex over Nim’s shoulder.  Nim brings him over and Alex introduces herself.  The two adults smile at each other.  Nim's voiceover narrates that this is how the story of the writer and the marine biologist began, but how it ends we don’t know.

The last shot of the movie is apparently at some time in the future.  The three of them are walking down the beach and Jack and Alex are holding hands.