Psychiatrist Dan Potter is appointed on the staff of Dr. Leo Bain’s experimental psychiatric hospital, known as the Haven, in New Jersey. His predecessor, Dr. Merton, has taken a new position in Philadelphia. Dan, his wife Nell, and their daughter Lyla, move into a rural home in the area. At Haven, Dr. Bain uses lenient security methods, except with the third-floor patients, whom he keeps contained with an electric security door. Among them are former POW Frank Hawkes, pyromaniac evangelist Byron “Preacher” Sutcliff, obese child molester Ronald Elster, and a shy serial killer John “the Bleeder” Skagg, who refuses to show his face. Angered by Dr. Merton’s departure, the third-floor patients irrationally blame Dan, believing he has murdered Merton and taken his place. The four men make plans to kill Dan, and retrieve his address from Dr. Bain’s office.
Dan’s younger sister, Toni, who has recently suffered a nervous breakdown, arrives to visit. Dan, Nell, and Tony go to a local rock club, while Lyla is left with babysitter Bunky. A regional power outage occurs that night rendering all electricity in the town ineffective. The security system at Haven fails, and the four men on the third floor escape, killing security guard Ray in the process, before killing another doctor and stealing his car. They stop by a local strip mall that is being looted during the blackout, and arm themselves with weapons from a sporting goods store.
The next morning, Preacher arrives at the Potter residence, pretending to be delivering a telegram, but Dan is not home. While Lyla is at school, Nell accompanies Toni to a nuclear power protest, where the women are arrested. Lyla arrives home from school and finds Ronald in the house, claiming to be a babysitter. After Nell phones Dan from jail explaining what has happened, Dan calls Bunky, who goes to check on Lyla. She finds Lyla asleep in her room, and invites her boyfriend Billy there to have sex. Preacher kills Billy by dragging him beneath the bed and stabbing him, while Ronald strangles Bunky. Lyla later awakens unharmed, but Ronald has vanished. Dan arrives home with Nell, Toni, and Tom, a fellow protester Nell and Toni met in jail, whom Toni is attracted to. They find police at the house, and Detective Barnett interviewing Lyla about the missing Bunky and Billy. Lyla explains that a man named Ronald babysat her; Dan recognizes him as one of the Haven patients.
Dan and Nell invite Detective Barnett, to stay for dinner. While investigating a noise outside, Barnett is killed with a crossbow by Frank, which is witnessed by the entire family. Finding the phone lines cut, the family barricade themselves in the house. Meanwhile, Dr. Bain arrives after unsuccessfully attempting to reach Dan by phone, but is hacked to death by Preacher with an axe. Dan attempts to reason with the men, assuring them he has not killed Dr. Merton. Ronald throws Barnett’s body through a window, and Preacher manages to infiltrate the basement, where he starts a fire. Dan bludgeons Preacher with an extinguisher canister before putting out the fire, locking the basement door behind him.
Ronald enters the kitchen and attempts to kill the family, but they work together to disarm him, before Tom kills him with a cleaver. Dan flees outside to retrieve Leo’s car. While he does, Tom’s nose begins bleeding profusely, revealing his identity as Skagg, the fourth patient. Skagg attempts to kill Toni, but Nell stabs him to death. Hearing the screams, Dan flees back into the house. Moments later, Preacher bursts out of the basement, but Dan stabs him to death. Frank appears with his crossbow, proclaiming, “It’s not just us crazy ones who kill.” Dan pleads Frank to spare his family. Suddenly, the electricity is restored, and Frank witnesses Dr. Merton being interviewed on a local news station about the missing patients. Hysterical, Frank smashes the television and flees into the night.
A short time later, Frank arrives at the local rock club. A drunken woman approaches him inside. He pulls out a pistol, pointing it to her neck. Assuming he is playing a joke, the woman laughs, and so does Frank.