San Francisco police detective John “Scottie” Ferguson is forced to retire after he is involved in a rooftop chase and his acrophobia and accompanying vertigo leads to the death of a fellow officer. Although Scottie hopes to overcome his phobia, his longtime friend, Midge Wood, an artist who is in love with him, cautions him that only a severe emotional shock might snap him out of it. One day, Scottie tells Midge that he has been contacted by Gavin Elster, an old college friend. Scottie meets with Elster at his office near the waterfront, where Elster oversees a shipbuilding business. Elster informs Scottie that he is worried about his young, blonde wife Madeleine, whose rich family built the business that Elster runs. Scottie is baffled by Elster’s claims that Madeleine has been having blackouts and seems to be possessed by someone from the past. Although Scottie is reluctant to become involved, Elster convinces him that he needs a friend to observe Madeleine before he commits her to a mental institution. That night, Scottie goes to Ernie’s, a popular restaurant, so that he can see Madeleine for the first time as she dines with her husband. Scottie is awed by Madeleine’s beauty and the next morning, follows her as she leaves home and goes to a flower shop to buy a nosegay. Seeming to be in a trance, Madeleine then goes to the cemetery of the old Mission Dolores and stands before a grave. After Madeleine departs, Scottie reads the gravestone, which belongs to Carlotta Valdes, who died in 1857 at the age of 26, the same age as Madeleine. Scottie then follows Madeleine to the Palace of the Legion of Honor art gallery and watches as she sits motionless in front of a portrait of a young woman. Scottie is stunned to see that the nosegay Madeleine carries is an exact duplicate of the one in the portrait, and that she even wears the same hairstyle as the painting’s subject. Upon learning that the painting is called “Portrait of Carlotta,” Scottie follows Madeleine as she drives to the McKittrick Hotel, where she enters a room on the second floor. The landlady, who knows Madeleine as Carlotta Valdes, tells Scottie that “Carlotta” comes to the hotel for a few hours several times a week. When Scottie searches the room, however, Madeleine has disappeared. Scottie then goes to Midge’s and when he asks about sources of information about old San Francisco, she takes him to see bookstore owner Pop Leibel. Pop relates that Carlotta was a young beauty, reared in an old mission and romanced by a rich, older man who built a mansion for her. After their child was born, however, the man took the child and deserted Carlotta, who went mad and committed suicide. Scottie is intrigued when Pop states that Carlotta’s mansion eventually became the McKittrick Hotel. The next day, Scottie tells Elster of his findings, and Elster confesses that he knew about Carlotta but did not tell Scottie in order not to prejudice him. Elster reveals that Carlotta was Madeleine’s great-grandmother, but when Scottie declares that it would be natural for Madeleine to become obsessed with her ancestor, Elster asserts that while Madeleine’s mother told him the truth, she never told Madeleine for fear of upsetting her with the knowledge of insanity in their family. Elster insists that Madeleine, who owns several pieces of Carlotta’s jewelry, including the distinctive necklace she wore while sitting for her portrait, has become possessed by Carlotta. Later, Scottie again follows Madeleine, with whom he has become obsessed, as she goes to the museum and then to Fort Point underneath the Golden Gate Bridge. When Madeleine suddenly throws herself into the water, Scottie jumps in and rescues her. Scottie takes the unconscious Madeleine to his apartment to recover and when she awakens, she claims to have no memory of the incident, although she does recall being at Fort Point. When Scottie then asks her if she has ever been to the art gallery containing Carlotta’s portrait, she states that she has not, confirming Elster’s assertion that she does not remember her wanderings to places connected to Carlotta. Their conversation is interrupted by a phone call from Elster, and while Scottie updates him on Madeleine’s condition, Madeleine departs. The following day, Scottie is tailing Madeleine when she comes to his apartment to leave him a note. Scottie suggests that they take a drive, and they go to a Sequoia forest, where they discuss the ephemeral nature of time and memory. As Scottie presses her about why she jumped into the bay, and about “where” and “when” she currently is, Madeleine relates that she feels like she is walking down a long corridor, covered with mirrored fragments that reflect a life not her own, yet familiar. When Scottie continues to question her, Madeleine reveals her fear that she is insane and will die soon. Scottie embraces her and assures her that he will never let her go, and their relationship is sealed with a passionate kiss. Sometime later, Madeleine awakens Scottie late one night, telling him that she had a recurring nightmare about an old Spanish church. Scottie recognizes her description of the area as nearby San Juan Bautista, an old, Spanish mission that has been preserved as it was one hundred years ago, but Madeleine insists that she has never been there. That afternoon, Scottie takes her there to reassure her that it is a real place and that she has nothing to fear from it. In the livery stable, Madeleine describes having lived at the mission, as if recalling Carlotta’s memories of her youth, and Scottie tries to reason with her, showing her things that she might have once seen and become confused about. After sharing another passionate kiss with Scottie, Madeleine runs off, crying that although she loves him, there is something she must do, and that it is too late for them. Scottie follows her as she races up into the church’s bell tower, but as he climbs the stairs, begins to suffer from vertigo. Madeleine reaches the top of the tower before Scottie, and as he looks through a window, sees her fall to the roof of the church below. Devastated, Scottie leaves the scene. Soon after, at the coroner’s inquest, Madeleine’s death is ruled a suicide, although the official lambasts Scottie’s lack of action. Elster consoles Scottie, asserting that it was his fault for getting Scottie involved, and tells him that he is moving to Europe. After having a terrifying nightmare about Madeleine’s death, Scottie suffers a nervous breakdown and is institutionalized for a year. Upon his release, Scottie sees women resembling Madeleine everywhere he goes until one day, he sees a redheaded woman who looks so strongly like Madeleine that he follows her to her room in a cheap hotel. There, the woman, whose name is Judy Barton, believes that Scottie is trying to pick her up, but when he confesses that she reminds him of someone he once loved, she softens and agrees to dine with him that evening. After Scottie departs, however, Judy begins to pack, then writes a letter to Scottie, confessing that Elster concocted a scheme to kill his wife and make Scottie a dupe to cover his crime. As Judy writes, she recalls how Elster transformed her, his mistress, into a sophisticated double of the real Madeleine, then employed Scottie to follow her, and as they hoped, Scottie fell in love with her. Judy had not planned on reciprocating his love, however, and was distressed upon having to betray him by running to the bell tower, from which Elster threw the already dead body of his wife. Deciding that she wants to make Scottie love her as herself, not as Madeleine, Judy destroys the letter. After dinner, Scottie begs to spend more time with her and Judy consents, although as the days pass, she is unnerved by his attempts to transform her into Madeleine by buying her similar clothes and having her hair dyed platinum blonde. Desperate to regain his affection, however, Judy goes along with his efforts until she looks just as she did when she was impersonating Madeleine. His dream of resurrecting Madeleine achieved, Scottie kisses Judy deeply, recalling the last time that he kissed Madeleine before her death. As they prepare to go out, however, Judy unthinkingly dons Carlotta’s necklace, and Scottie deduces Elster’s scheme, and Judy’s part in it. Scottie drives the nervous Judy to San Juan Bautista and there forces her to climb the bell tower, stating that this is his “second chance.” As they climb, Scottie realizes that he no longer suffers from vertigo, and Judy confesses to her part in the crime, revealing that Elster discarded her after his wife’s death. Alternately calling her Madeleine and Judy, Scottie tells her how much he loved her, and Judy responds that they can begin again, with her transformation back into Madeleine as proof of her love for him. Just then, a nun comes into the tower and her footsteps frighten Judy, who steps back and fall to her death on the roof below. Shattered, Scottie looks down at her body.