In medieval Germany, a band of Teutonic Knights massacre a village of supposed devil-worshippers and bury their bodies underground, building a Gothic cathedral over the mass grave as a means to contain the demonic evil within.
In the present day, the cathedral's new librarian Evan Tomas Arana arrives for his first day on the job. He meets Lisa Barbara Cupisti, an artist supervising a restoration of the church's elaborate frescoes, who introduces him to the surly Bishop Feodor Chaliapin Jr. and the kindly Father Gus Hugh Quarshie. The Bishop warns Evan not to enter the church's catacombs, nominally due to their instability.
Lisa soon discovers a mysterious parchment carrying what resemble architectural schematics. With the help of Evan, they sneak the parchment back to Lisa's home. As the two bond over their mutual interest in medieval art and architecture, they have sex. It is halted when Evan has a sudden realization and finds hidden Latin text on the parchment referring to a "stone with seven eyes".
Evan later explores the catacombs to find the stone. Evan uncovers the stone in a hidden crypt; on opening it, the crypt reveals a vast, seemingly endless black void. A blue light radiates from the hole and reveals a sack. On opening it, Evan is grabbed by hands from the inside before he blacks out. When he regains consciousness, the sack and hands are gone, and his wrists are bleeding. As Evan flees a sacristan Roberto Corbiletto investigating intruders, he loses control of his hands and tears out his still-beating heart, biting into it. Back at home, Lisa experiences dreams of the unsealed hole and a vast, candle-filled atrium. When awake, she is attacked by a goat-headed demon and flees in terror. The sacristan begins experiencing the same terrifying symptoms.
The next day, Lisa goes to Evan's office, where he is acting strangely. He tries to sexually assault her, and she flees, shocked and horrified. Evan likewise menaces the sacristan's daughter Lotte Asia Argento, with whom he'd previously been amiable. The two menacing turns push those inside the church toward a breaking point. Having a moment of clarity, the sacristan rushes to the confession booth and tells Father Gus that he has become demonically possessed and fears losing control. To Gus' horror, he rushes to the cellar and kills himself with a jackhammer. His death triggers security mechanisms that seal the church, trapping everyone inside. The occupants begin experiencing increasingly elaborate and deadly visions. As the occupants try to find a way out, Gus confronts the aloof Bishop, who reveals that he intends to let the evil inside kill the occupants before being unleashed on what he sees as a corrupt world, before accidentally falling to his death.
Inside, those trapped start dying in droves. At a nightclub in town, Lotte senses something wrong and rushes to the church through a secret passage in the aqueduct. Meanwhile, Lisa falls into a trance and wanders into the cellar, finding herself in the same candlelit atrium of her dreams. She lies atop an altar and is raped by Evan, who is now fully transformed into a goat-headed demon.
Searching the Bishop's office, Gus finds ancient records recounting the church's creation. Lotte enters and, upon seeing someone who resembles her in a woodcut depicting the massacre, is suddenly flooded with memories from centuries prior. She reveals that the church's architect was left to die within the building, and that his body contains a self-destruct mechanism for the structure. Gus tells Lotte to flee, and he makes his way to the chapel hall as the dead bodies of the massacre victims buried beneath the church begin to rise. Before the evil force can be fully released, Gus uncovers the architect's mummified body hidden beneath the floor and activates the self-destruct mechanism. The building collapses, and Lotte escapes alive.
Lotte later returns to the church ruins with flowers. A passing truck unearths the stone seal and blows it open, emitting blue light from within, leaving her smiling with a quiet, enigmatic optimism.