Anna Sasaki is an introverted 12-year-old girl who lives in Sapporo with foster parents, Yoriko and her husband. Anna is distant and unhappy with them, because she finds out that they receive money from the government to take care of her but will not discuss her feelings, leaving her foster parents mystified and worried by her behaviour. One day at school, she collapses from an asthma attack and her parents send her to spend the summer with Setsu and Kiyomasa Oiwa, relatives of Yoriko, in a rural, seaside town where the air is clear, located between Kushiro and Nemuro.
Anna sees an abandoned mansion, dilapidated and overgrown, across a salt marsh and wades across the marsh to investigate it. She looks around, wondering why it seems so familiar to her, but gets trapped there by the rising tide. Toichi, a taciturn old fisherman, brings her back to the pier with his rowboat, and Anna sees the house for a moment in good repair and well-lit. When she returns to the Oiwa’s, Setsu tells her that the mansion used to be a vacation home for some foreigners, but that it has been empty for a long time. Starting that night, Anna has dreams of seeing a blonde girl in the mansion, having her hair brushed by an old woman.
On the night of the Tanabata festival, Anna fights with Nobuko Kadoya about her blue eyes, an unusual feature which Anna cannot explain because she does not know who her biological family is. As she runs away, she discovers a rowboat by the shore and rows it across the marsh to the mansion, where she meets Marnie, the blonde girl. Anna tells Marnie about her dreams, but Marnie assures Anna that she is not dreaming now. The two agree to keep their meeting secret and they meet again on the next evening. Marnie invites Anna to a party at the mansion, which is filled with guests. Marnie disguises Anna as a local flower girl to get her into the party. While there, Anna sees Marnie dancing with a boy named Kazuhiko. Later some townspeople find Anna asleep by the post office. The next day, Anna returns to the mansion, but it appears abandoned and dilapidated again.
One week later, while sitting on the shore sketching in a sketchbook, Anna meets Hisako, an older woman who paints pictures of the marsh and the mansion. Hisako comments that Anna’s sketches look like a girl whom she knew when she was young, and she used to live in the mansion. She also tells her that the mansion is being renovated because someone is moving in. Anna runs to the mansion, where she meets a girl named Sayaka, who discovers Marnie’s diary hidden in the drawer. The diary includes an account of the party with the flower girl. Several pages are missing at the end of the diary.
The next day, Marnie reappears and tells Anna about how her parents are always traveling abroad, how they leave her in the mansion with her nanny and two maids, and how the nanny and maids abuse her physically and psychologically and that they used to threaten to lock her in the silo near the mansion. Anna leads Marnie there where she helps her confront her fear, but Anna wakes up to find that Marnie had left her behind in the silo. Meanwhile, Sayaka finds the missing pages from Marnie’s diary, which include passages about Kazuhiko and the nearby abandoned feed silo. Sayaka and her brother head for the silo, thinking Anna may be there, and find her unconscious and feverish along the path. While in her feverish state, Anna has a dream about her, confronting Marnie who tells Anna she is sorry for leaving her and that she cannot see Anna anymore. Marnie begs Anna for forgiveness to which she sadly vows to remember Marnie and the things she did for her, as she is swept away by the tide.
When Anna recovers from her fever, Sayaka shows her the missing pages and a painting Hisako gave to Marnie. They converse with Hisako, who tells them about Marnie’s story, that she married Kazuhiko and had a daughter named Emily, Kazuhiko died from an illness, Marnie was committed to a psychiatric hospital and Emily was sent to boarding school. After Marnie was released, Emily blamed Marnie for abandoning her. Emily ran away and had a daughter herself, but she and her husband were killed in a car accident when their daughter was one year old. Marnie raised her granddaughter who was placed in foster care, after Marnie’s death.
At the end of the summer, Yoriko goes to the town to take Anna home. She gives Anna a photograph of the mansion and says it belonged to Anna’s grandmother. When Anna sees Marnie’s name written on the back, she realizes that she is Emily’s daughter and Marnie’s granddaughter. This revelation helps to bring Anna closure about her identity, her unusual blue eyes and most importantly, that she was loved and wanted by her biological family. Yoriko also tells Anna about the government payments for her care, however Anna admits she knew about the payments but now no longer cares about them. For the first time, Anna calls Yoriko her mother. During the end credits, Anna says goodbye to her friends she met in town, before seeing Marnie in the mansion waving goodbye to her, as Yoriko drives Anna back home.