In 2010, in the Afghan desert, a four-person US Army team is diverted from routine patrol by Staff Sergeant Roger Dorrich for an unsanctioned kill mission at a farmhouse. Nick Jones senses deception but follows orders as Dorrich kicks in the door and opens fire on a family, killing all eight civilians. The massacre is a calculated robbery: in the farmhouse's back room, Dorrich and teammate Rick Master find duffel bags containing roughly $4 million in "ghost money," covert Central Intelligence Agency (CIA) cash used to buy safe passage through Taliban zones. To sell the cover-up, Master shoots the fourth team member, Karli Breecher, in the stomach. The team fabricates a firefight story that superiors accept, and each member receives roughly $1 million.
Twelve years later, former Boston police detective Bill Robinson narrates from the Inn by the Sea, a bed-and-breakfast in Gloucester, Massachusetts, envisioned by his late wife Siobhan before her death in a road accident. The inn houses a volatile mix of permanent residents: Nick, now a veteran who has schizophrenia; Bill's girlfriend Susan Solie, a former Federal Bureau of Investigation (FBI) agent; Effie Johnson, a handywoman who does not speak; Angelica Grace Thomas-Lowell, a bestselling novelist; Vinny, an elderly ex-gangster who uses a wheelchair; Sheriff Clayton Spears; and Neddy Ives, a recluse on the third floor. Bill watches Nick obsessively redialing Dorrich's number, recognizes the warning signs of a psychotic episode, and persuades Nick to attend the funeral of former police captain Mark Bulger.
At the reception, Shauna Bulger confides that she long suspected her husband of corruption. That night, Nick has a psychotic break, attacking a stranger and accusing Bill of wearing a surveillance device. Bill defuses the episode. During the chaos, Breecher calls Nick's phone; Bill pockets it without answering.
In Needham, two of local criminal Norman Driver's employees, Pooney and Marris, drag Shauna from bed and demand the contents of a safe she knows nothing about. When the pair turn on each other, Shauna pulls her husband's shotgun and kills Marris. She cleans the scene, seals the body in a suitcase, and investigates Mark's files. In a hidden floor safe, she finds suppressed evidence from unsolved cases, including material linking Driver to the 1989 rape and murder of a young woman named Georgette Winter-Lee.
Driver is Gloucester's new criminal kingpin, using construction crews that strip asbestos from houses as cover for pop-up fentanyl laboratories. He drowns Pooney and sends men to Shauna's house, but she has already loaded everything into Mark's truck and driven to Gloucester.
Bill arranges a meeting with Breecher, who reveals Dorrich killed himself and plays his final voicemail warning that someone discovered what the team did. Nick confesses the massacre to Bill but withholds the stolen money and Breecher's deeper involvement. Bill pledges support, though Nick warns exposure means life in prison.
Shauna arrives at the inn bruised and evasive, leaving Mark's truck. When a necklace with a cursive "M" falls from the truck's doorjamb, her panic confirms she is hiding something. She drives to Driver's home, fires a hunting rifle at his property, and names Georgette Winter-Lee over Marris's phone, vowing revenge.
Bill and Susan investigate Dorrich's apartment, finding evidence his death may not have been suicide. On the drive home in Shauna's truck, a vehicle marked DRIVER CONSTRUCTION SERVICES rams them off the highway. Armed men drag them into the woods, but when one opens an ejected suitcase and discovers Marris's body, the shock allows Bill to grab a gun and escape.
Driver escalates, posing as a guest at the inn to corner Angelica in her bedroom. Neddy intervenes by tossing a live grenade into Driver's hands, keeping the pin on a string, and walking him out. Vinny poisons two of Driver's men at a diner. Driver whispers to Bill that he will kill everyone in the house.
Nick retrieves his untouched duffel bag from the inn's crawl space and records a video confession, scheduling it to post on Twitter. Bill, Susan, and Clay trap Shauna by texting a staged photo to Marris's phone, luring her to the marina. She is arrested, but she fakes a medical emergency, overpowers Clay, and escapes.
That night, Breecher arrives at the inn. As Nick opens the front door, Driver and two men crash through the kitchen, led by Breecher. Driver shoots Vinny dead and wounds Neddy. Breecher reveals the full truth: She overheard the plan before the massacre, intended to let Dorrich and Master kill Nick so she could murder them and take all the money, and killed Dorrich when he refused to surrender his share. She demands Nick's share.
Nick uses the scheduled confession as leverage, buying time for Effie and the wounded Neddy to escape. Breecher kills Driver's remaining men and forces Nick into the forest at gunpoint. He leads her to a pine tree where he says the money is buried. When she digs up the bag and unzips it, a grenade Nick rigged inside detonates, killing her.
Bill and Susan return to the devastated inn. Driver fires on them from upstairs. Bill climbs the drainpipe to Neddy's room, but when he forces the locked door and fires at what he believes is Driver, he accidentally hits Susan in the upper chest. Driver escapes out a window. En route to the hospital, Bill spots Shauna confronting Driver in the road. Her rifle jams, and Driver tackles her. Bill accelerates and strikes Driver with the car, killing him. He offers Shauna his hand, but she does not move, and he drives on to save Susan.
Separately, Clay has been sheltering April Leeler and her young son Joe at the inn, believing April is fleeing an abusive partner. At a motel, Clay watches Joe build a female avatar on an iPad and name it "Zoe." He discovers April used his police terminal to search for Thomas Oscar Savage, wanted in the suspected murder of his daughter Zoe Savage in Omaha. News confirms a schoolteacher kidnapped Zoe and disguised her as a boy. Clay kicks in the motel door, orders the child to come to him, and shoots April when she reaches for a knife. He flies Zoe to Omaha, delivers her to detectives, and walks alone back to Departures.
Bill endures four days at the hospital before Susan wakes from an induced coma, missing half her left lung. He proposes; she accepts on the condition he shower and bring her a vending-machine snack. Nick's confession garners national attention, but the Army discredits it, with Rick Master as the military's witness; the CIA dismisses the ghost-money claims as products of Nick's schizophrenia. Shauna vanishes, though the evidence she mailed to the inn allows Clay to reopen the Winter-Lee cold case. Neddy's room contains a wall-to-wall investigation into his conviction for murdering his wife; he served 27 years in prison and appears to be working to prove his innocence. Clay, hailed as a hero, sinks into depression. Bill coaxes him toward recovery as journalist Katie O'Leary arrives to interview Clay about his rescue of Zoe Savage. Bill reflects that no darkness has yet outmatched the people inside the inn.