Annie Graham (Toni Collette), miniaturist artist, lives with her husband Steve (Gabriel Byrne), their teenage son Peter (Alex Wolff), and their 13-year-old daughter Charlie (Milly Shapiro). At the funeral of her mother, Ellen, Annie delivers a eulogy explaining her fraught relationship with her mother, who was extremely secretive. Steve is informed that the grave has been desecrated, while Annie thinks she sees Ellen in her workshop. At a support group for those who have lost love ones, she reveals that the rest of her family growing up, including Ellen, suffered from mental illnesses.

Annie forces Peter to take Charlie with him to a party. While unsupervised, Charlie eats a piece of chocolate cake, not realizing that it has nuts. She falls into anaphylactic shock, and Peter attempts to rush her to the hospital. On the way, Charlie opens and partially climbs out of the car window to get more air. When Peter swerves to avoid a dead animal in the road, she is decapitated when her head collides with a telephone pole. Peter drives home in shock without alerting his parents, who discover Charlie’s body in the morning.

The family grieves terribly and tensions heighten between Annie and Peter. Peter, who appears to suffer from some form of PTSD, begins hallucinating Charlie’s presence around the house. Annie attempts to return to the support group, where she is approached by fellow member Joan (Ann Dowd). When Annie visits Joan’s apartment, she reveals that she used to sleepwalk and recounts an incident where she woke up in Peter’s bedroom to find herself, Peter, and Charlie covered in paint thinner and with matches in her hands.

Joan tells Annie that she has learned to communicate with her deceased grandson through a séance. After convincing Annie to participate, she shows the connection is real. Joan tells Annie how to perform the séance. Following a nightmare in which Annie reveals to Peter that she purposely attempted to miscarry him when she was pregnant, Annie convinces her family to attempt the séance, but it goes afoul when a glass cabinet is smashed and Annie is seemingly possessed by Charlie. Steve wakes her and the possession ends.

Annie suspects Charlie’s spirit has become malevolent. She throws Charlie’s sketchbook into the fireplace, only for her arm to also catch fire. She retrieves it and heads to Joan’s apartment for advice, but Joan is nowhere to be found. Annie goes through her mother’s things and finds a photo album linking Joan to Ellen, as well as a book in which Ellen had highlighted a section mentioning the demon Paimon, a “king of Hell” who wishes to inhabit the bodies of vulnerable males. Annie searches the attic and finds a body she believes to be Ellen. Meanwhile, Peter breaks his nose in class as a result of a hallucination. Annie shows Steve her mother’s body and the sketchbook, insisting he burn it. Steve refuses, believing Annie lost her mind and moved Ellen’s corpse herself. Annie burns the sketchbook herself, only for Steve to catch fire and burn to death. Annie is then seemingly possessed by Paimon. Peter awakens, finds his father’s dead body, and is chased by Annie into the attic. More of Ellen’s followers confront him, and Annie appears in the ceiling, beheading herself with wire. Peter jumps out the window to escape and is knocked unconscious.

A pulsing light appears to enter Peter’s body. He wakes up and follows Annie’s levitating corpse into the family tree house, where he finds Charlie’s crowned head resting atop a statue of Paimon while Joan, other members of the coven, and the headless corpses of his mother and grandmother bow to him. He stares despondently as he is crowned by Joan and welcomed as the new host of Paimon.