The film is set in the fictional town of Gatlin, Nebraska, an agricultural community surrounded by huge cornfields. In 1980, the town appears to be neglected except for the church, and residents choose Biblical names over more modern ones. When the corn crop fails one year, the townsfolk turn to prayer to ensure a successful harvest. However, 12-year-old Isaac Chroner takes all of the children in Gatlin into the cornfields and indoctrinates them into a religious cult based around a bloodthirsty deity called “He Who Walks Behind the Rows”. Isaac and his subordinate, 18-year-old Malachi, lead the children in a revolution, murdering all of the adults (ages 19 and up, since 18-year-olds are seen as halfway between teenager and adult) in town as human sacrifices, poisoning and butchering them. Only Job and his sister Sarah, are not involved, as Sarah was sick and Job was not allowed to attend the meetings in the corn with the other children. It is revealed in the opening credits that Sarah has visions, which are portrayed through the credits via drawings.
Three years later, on October 31, 1983, Vicky Baxter and her boyfriend Burt Stanton travel through rural Nebraska on their way to Seattle, where Burt will start working as a physician. Elsewhere, a young boy named Joseph tries to flee Gatlin, but is attacked in the corn; he stumbles out into the road and Burt accidentally runs him over with his car. However, Burt discovers that his throat was cut beforehand. Burt and Vicky place Joseph and his suitcase in their trunk and search for a phone to call for help. They find elderly mechanic Diehl, the last adult in Gatlin, but he refuses them service; he is in an agreement to supply the children with fuel in exchange for his life. But the merciless Malachi breaks the pact and murders him, against Isaac’s wishes, when Diehl tries to steer the couple away from Gatlin.
Vicky and Burt explore the abandoned town and find Sarah alone in a house; while Vicky stays with her, Burt searches the town. Malachi and his followers appear, capture Vicky, and take her to the cornfield, where they place her on a cross to be sacrificed. Burt enters the church, where a congregation of children led by a girl named Rachel are performing a cultural birthday ritual for Amos by drinking his blood from a pentagram-shaped cut on his body. Amos has turned 19, so is considered old enough for his “passing”—joining their god in the cornfield. Burt scolds the children for participating in a blood ritual and an enraged Rachel stabs Burt then Malachi and the others chase him. Job rescues Burt and they hide in a fallout shelter with Sarah, where they learn Vicky was captured, and agree to help him rescue her.
The zealous Isaac scolds Malachi for his treachery in killing Diehl, their only source of fuel. Malachi, tired of Isaac’s preaching, takes over, ordering Isaac to be sacrificed instead of Vicky. Isaac warns Malachi that sacrificing him will break their pact with He Who Walks Behind the Rows and the children will be severely punished. That night, Burt sneaks into the cornfield to rescue Vicky. During Isaac’s sacrifice, a supernatural light appears and devours the screaming Isaac. Burt emerges and fights Malachi. After pushing him to the ground, Burt convinces the children to abandon the cult and run for safety. But Isaac suddenly reappears, revived by He Who Walks Behind the Rows. He tells Malachi that the deity is angered over him being sacrificed. Informing Malachi that He Who Walks Behind the Rows wants his sacrifice too for his betrayal, Isaac seizes and kills the terrified Malachi by breaking his neck.
A storm appears over the cornfield, and Burt and Vicky shelter the children in a barn. Burt reads a passage in the Bible Job gives him; Job also reveals that the police officer tried to set up the gasohol to stop He Who Walks Behind The Rows, but Malachi murdered him before he could finish. Vicky rereads the passage and realizes that the cornfield must be destroyed by fire in order to stop the false god. Burt sprays the cornfield with gasohol and tosses a Molotov cocktail into the field, setting it alight and destroying the demon along with Isaac. Vicky, Burt, Job, and Sarah return to the car to leave Gatlin, but find it disabled. Rachel attacks Burt, but Vicky knocks her out with the car door. He is worried about just leaving her there, but Vicky quips that they will send her a get-well card from Seattle, and they depart with the kids.