In Morocco, Frank Cotton buys a puzzle box from a dealer. In a bare room, Frank solves the puzzle box. Immediately, hooked chains emerge from it and tear into his flesh. Later the room is filled with swinging chains spattered with the remnants of Frank's body. A black-robed figure picks up the puzzle box and returns it to its original state, restoring the room to normal.
Frank's brother, Larry, has decided to move into his childhood home in an attempt to rebuild his strained relationship with his second wife, Julia, who had an affair with Frank before marrying Larry. Larry's teenage daughter, Kirsty, has chosen not to live with her stepmother and moves into her own home.
The abandoned home shows traces of Frank's recent presence, but Larry assumes Frank has fled the authorities. Larry cuts his hand on a nail, and drips blood on the attic floor, which conceals the remnants of Frank's body. The blood resurrects Frank. That night, Julia finds Frank in the attic. Still obsessed with him, she agrees to harvest blood for him so that he can be fully restored and they can run away together. Julia begins picking up men in bars and bringing them back to the house, where she murders them. Frank consumes their blood, regenerating his body. Frank explains to Julia that he had exhausted all sensory experiences and sought out the puzzle box on the promise that it would open a portal to a realm of new carnal pleasures. When solved, the box opened up a portal to the realm of the "Cenobites", who subjected him to the extremes of sadomasochism.
Kirsty spies Julia bringing men to the house and, believing her to be having an affair, follows her to the attic, where she interrupts Frank's feeding. Frank attacks her, but Kirsty throws the puzzle box out the window, creating enough of a distraction for her to escape. Kirsty retrieves the box and runs away, but, shaken by her experiences, collapses shortly thereafter. Awakening in a hospital, Kirsty solves the puzzle box, summoning the Cenobites and a two-headed monster, which Kirsty narrowly escapes from. The Cenobites' leader, Pinhead, explains that although the Cenobites have been perceived as both angels and demons, they are simply "explorers" of the carnal experience, and they can no longer differentiate between extreme pain and extreme pleasure. Although they attempt to force Kirsty to return to their realm with them, she lets their leader know that one of their "subjects" has escaped, and suggests giving them Frank in exchange for her freedom. They accept.
Kirsty returns home, where Frank, posing as Larry, tells her he had to kill a deranged Frank. Julia shows her a flayed corpse in the attic, locking the door behind her. The Cenobites appear and demand the man who "did this". Kirsty runs out of the room and tries to escape, but is held by Julia and Frank. Frank reveals his true identity to Kirsty, and, when his sexual advances are rejected, he decides to kill her to complete his rejuvenation. He accidentally stabs Julia instead and drinks her blood without remorse.
Frank chases Kirsty to the attic, and when he is about to kill her, the Cenobites appear. Now sure he is their prey, they ensnare him with chains and tear him to pieces. They then attempt to abduct Kirsty. Ripping the puzzle box from Julia's dead hands, Kirsty defeats the Cenobites by reversing the motions needed to open the puzzle box, sending them away in a burst of electricity. Her boyfriend shows up and helps her escape the quickly deteriorating house.
As Kirsty looks back at the house, it bursts into flames, and Kirsty throws the box into them. A vagrant who has been stalking Kirsty walks into the fire and retrieves the box before transforming into a winged creature and flying away. The box ends up in the hands of the merchant who sold it to Frank, who offers it to another prospective customer.