During a rooftop chase, detective John "Scottie" Ferguson witnesses a fellow policeman fall to his death. The shock of this event results in a disabling fear of heights that causes Scottie to retire from the police force. He's a mess—walking with a cane and wearing a back brace, he can't walk a flight of stairs without getting dizzy and panicked.
Early retirement gives him time to hang out with his ex-GF Midge, who's trying to help him recover. However, an unexpected request from an old college classmate cuts his retirement short. Seems Gavin Elster's wife, Madeleine, has been acting mad strange. She's taken to disappearing for whole days at a time and falling into trance-like states. Elster thinks she's been possessed by the ghost of someone—someone whose name turns out to be Madeleine's great-grandmother, Carlotta Valdes.
Scottie's skeptical at first, but he reluctantly agrees to follow her around. This being a Hollywood melodrama, Madeleine turns out to be the stunning Kim Novak, who captivates Scottie immediately. He's weirded out by some of the things she does, like staring for hours on end at a portrait of Carlotta Valdes, or renting a hotel room just to sit and space out, only to disappear. He rescues Madeleine when she jumps into San Francisco Bay in what looks like a suicide attempt that she claims not to remember.
Scottie falls passionately in love with Madeleine, and he's determined to help her figure out what or who is tormenting her. With Midge's help, he finds a local authority on San Francisco history who tells them the tragic history of Carlotta, who was seduced, abandoned, and committed suicide.
Scottie falls more and more deeply into obsessive lust for the mysterious and doomed Madeleine (the feeling is mutual), but he can't alleviate her suffering. Under the "influence" of Carlotta, she climbs the bell tower at the Mission San Juan Bautista. Scottie pursues her, but his fear of heights paralyzes him and he watches helplessly as Madeleine hurls herself to her death. Traumatized, he flees the scene. He spends a long time in a catatonic state in a mental hospital, diagnosed with "acute melancholia together with a guilt complex." Midge visits him there but can't reach him. His heart, she sees, still belongs to Madeline, the other blonde in his life.
After Scottie's release, he looks for Madeleine all over the city, revisiting all of the places where the two of them spent time together. He runs after every blonde who resembles her, only to be disappointed. His relationship with reality is still a little tenuous.
One day, Scottie sees a brunette who bears a striking resemblance to Madeleine and he follows her home. The woman claims to be Judy Barton, but he doesn't believe her. He asks her to dinner right away; he's insistent. Reluctantly, Judy agrees. After Scottie leaves her apartment she starts writing a letter, and we hear what she's writing in voiceover.
Judy confesses in the letter that Elster hired her to play the part of Madeleine as a way to cover up his plan to kill his wife. The whole story about Carlotta turns out to be made up—a cover-up for the cover-up. It turns out Madeleine was already dead when Elster threw her from the tower, at which point Judy-playing-Madeleine screamed in horror.
As if Judy isn't miserable enough, she falls in love with Scottie as he pursues "Madeleine." She tears up the letter, hoping to make Scottie fall in love with her real self. After a few dates, Scottie gets crazy. He starts to make Judy over in Madeleine's image. He gets her to dye her hair blonde and wear all of Madeleine's signature outfits. It's turning into a sick, fetishistic obsession which creeps Judy out, but she goes along in the hopes of getting him to love her.
Judy makes the colossal mistake of putting on a necklace that Scottie recognizes. It belonged to the real Carlotta and had been passed down to the real Madeleine. Now he suspects that he's been played somehow. He brings Judy back to the Mission at San Juan Bautista and the puzzle pieces fall into place. He drags her up the stairs of the bell tower and forces her to admit what happened.
Heartbroken, she tearfully confesses everything. She and Elster chose Scottie because they knew his vertigo would make it impossible for him to make it to the top of the tower to save Madeleine. She desperately begs Scottie to love her and keep her safe. She and Scottie make it to the top of the tower this time, but a final twist brings things full circle. A nun has heard the noise from the tower and comes up to check it out. Judy is terrified and jumps to her death. In the final frame, Scottie's left standing there stunned. Haunted by his past, he's recreated it.