When the film opens, the audience sees a young girl standing outside after school in the rain, waiting for her mother, who has yet to show up. The scene is dated 1974.
Flash forward to 2005, we see a grown-up Dahlia (Jennifer Connelly) in the midst of a bitter mediation with her ex-husband, Kyle (Dougray Scott), over sharing custody of their daughter, Cecilia, also known as Ceci (Ariel Gade). Kyle wants Cecilia to live closer to his apartment in Jersey City so the joint-custody agreement would be easier, but Dahlia wants to move to Roosevelt Island, where she has found a good school for Cecilia. Kyle threatens to sue for full custody because he feels the distance to see his daughter is too great. He claims that Dahlia is an "unfit" mother because she was abused by her father and abandoned by her mother at a young age. He also claims that Dahlia is "mentally unstable" and suffers from debilitating migraines, though Dahlia insists the migraines are not severe. Dahlia shouts that Kyle "doesn't even remember Cecilia's birthday and that he doesn't even like playing with her".
Dahlia and Cecilia see an apartment in a complex on Roosevelt Island, which is just a few blocks from Cecilia's new school. The super of the apartment building is Mr. Veeck (Pete Postlethwaite), who is charged with the general maintenance of the building's many lacking features. The manager, Mr. Murray (John C. Reilly), uses questionable tactics in order to rent the substandard and undersized apartment. During the tour, Cecilia sneaks up onto the roof where she finds a Hello Kitty backpack near a large water tank. They leave the bag with Mr. Veeck, and Mr. Murray promises Cecilia that she can have it if no one claims it in a week. Cecilia, who has disliked the apartment from the moment she arrived, now wants desperately to live there. Dahlia agrees and they move in.
Shortly after moving in, the ceiling in the bedroom begins to leak dark water. The source is the apartment above, 10F, where a family, the Rimskys, lived up until a month ago. Since then, two teens have reportedly been vandalizing the apartment. At one point, Dahlia enters 10F and finds the place flooded, with dark water flowing from every faucet in the apartment and from the walls and toilet. Dahlia finds a family portrait of the former tenants. There is a mother, father, and young girl who looks about Cecilia's age. Dahlia complains to both Mr. Veeck and Mr. Murray about the water, but the former does little about it despite the insistence of the latter. Things become even more strange for Dahlia when she has dreams of a little girl who appears to be Cecilia returning from a visit to her father's home, but the girl's appearance changes every time Dahlia looks away from her in the dream, so that she looks like the young girl in the portrait in 10F.
Cecilia has started school, but according to her new teacher (Camryn Manheim), she isn’t fitting in with the class and is spending too much time with an imaginary friend, named Natasha. A psychologist is recommended, but Dahlia refuses and tells Cecilia to ignore Natasha. This is made more difficult when Dahlia discovers the Hello Kitty backpack in the laundry room's garbage, although Mr. Veeck had said it was claimed. Dahlia leaves it in the garbage, but Cecilia finds it—in the elevator. The name in the backpack reads “Natasha Rimsky”.
The ceiling, shoddily patched up by Mr. Veeck, begins to leak again, but more heavily than before. At school, Cecilia appears to get into a fight with Natasha, who appears to control Cecilia's hand while painting. She's taken to the girls’ bathroom where she passes out after dark water starts gushing from the toilets and sinks. Dahlia, who is meeting with her lawyer, can’t be reached at work, so Kyle picks her up from the hospital and takes her to his apartment without telling Dahlia.
Dahlia breaks down when she can’t find her daughter and begins having strange dreams. These lead her back onto the roof and up the ladder of the water tank. She looks inside and finds Natasha’s body in there. When the police arrive, they discover that there was a grave miscommunication between the Rimskys; the father thought that Natasha was with her mother while the mother thought the girl was with her father. The father was an alcoholic who was known for always shouting, and the mom was no better. The mother left because she didn't feel she could care for Natasha, and the father left soon afterward, somehow under the impression that Natasha was with her mother. The girl was left alone in the abandoned apartment and fell into the water tank, which Mr. Veeck had left open. He was aware of her body, which was why he refused to fix the water problem plaguing the complex. Mr. Veeck is arrested and Mr. Murray is questioned.
Dahlia agrees to move closer to Kyle so the shared custody will go easier. As Dahlia is packing, Cecilia is taking a bath. A girl in a hooded bathrobe comes out of the bathroom, wanting to read with Dahlia. Dahlia begins reading, but when she hears voices in the bathroom, she realizes that the girl in the bathrobe is Natasha. Natasha begs Dahlia not to leave her, but Dahlia rushes into the bathroom to save Cecilia. Natasha then locks Cecilia in the bathtub (which has a shatterproof panel instead of a curtain) and holds her underwater. Dahlia pleads with Natasha, promising to be her mother forever. Natasha lets Cecilia go and floods the apartment, causing Dahlia to drown and fulfill her promise. Her ghost and that of Natasha then walk away down the hallway.
Kyle picks up the traumatized Cecilia from the police station, and weeks later, the two go back to pick up the rest of her stuff. Cecilia has a flashback of her and her mother looking at pictures together, and in the elevator, her mother's ghost braids her hair and comforts her—telling her she will always be there. Kyle, momentarily horrified with a malfunction in the elevator, the weird behavior of his daughter, and perhaps noticing her hair had been braided while in the elevator, finally takes her away to his own apartment in Jersey City.