In 1918, a war widow, Mrs. Allen [Vinette Robinson], and her children—Lucy [Tsion Habte], Jamie [Jason Rennie], and their baby Benjamin—struggle to survive in a cramped, squalid Camden Town flat as Christmas approaches. Just before the holidays, a poised but mysterious old man named Frederick Percival Blunden visits the family, presenting himself as a representative of a firm of solicitors. He offers them a chance to become the caretakers of a derelict country mansion in the Home Counties called Langley Park, which has been gutted by fire years earlier and is now under the care of the solicitors. Mrs. Allen accepts the post, hoping for a more stable future for her children, even though there are whispers that Langley Park is haunted. The solicitors’ office adds to the intrigue when the children glimpse a portrait that resembles Mr. Blunden; the solicitor confirms the likeness but reveals that the sitter in the painting is the elder Mr. Blunden, who has been dead for a century, while the present Mr. Blunden is his great-grandson.
Once they settle into Langley Park, Lucy and Jamie notice two ghostly figures prowling the grounds: Sara Latimer [India Fowler], a teenage girl, and her younger brother Georgie [Xavier Wilkins], two children who once inhabited the house a century earlier. Sara explains that she and Georgie are orphans under the care of their dissolute Uncle Bertie [Sam Spruell] and the solicitor Mr. Blunden [Simon Callow], until Georgie comes of age. As time passes, Bertie marries a music hall performer, Bella Wickens, and her parents move into Langley Park as housekeeper and game keeper. Soon, Lucy and Jamie come to suspect that Mrs. Wickens [Tamsin Greig] and her volatile husband are plotting to kill them so that they can claim Georgie’s inheritance. The ghosts reveal a way out: Sara and Georgie have found a book containing instructions for traveling through time, and they vow to find help.
Jamie and Lucy decide to join Sara and Georgie on their journey, with a plan to meet them the following day. In the churchyard, Jamie digs with the hope that their mission will succeed and that the grave they uncover will be empty. Instead, he and Lucy discover a gravestone bearing the names of Sara Latimer and Georgie Latimer. The sexton explains that the children died in a fire, its anniversary exactly one hundred years away. The quartet together confronts Mr. Blunden, who admits he has been tormented for more than a century by the events, but promises that if they help, no harm will befall them. Lucy and Jamie drink a potion from the book and travel back to 1818, where they meet Thomas the gardener, who dreams of going to America to make his fortune. Mr. Blunden is visiting Langley Park that night but refuses to listen to Sara’s pleas for help.
That night, the children are locked in a room above the library and given sleeping draughts. Mr. Wickens starts a fire in the library, trapping them. Jamie assists Tom in rescuing Sara, but he cannot pass through the flames to reach Georgie. Mr. Blunden arrives and tells Jamie that they will go together, holding hands. Jamie is saved from the blaze, but Blunden endures the pain Jamie would have felt. Jamie and Blunden manage to rescue Georgie, though the staircase collapses, and Blunden perishes as the house burns around them. Wickens and his wife perish as well. Lucy and Jamie return to 1918, though Jamie is unconscious and Lucy cannot disclose the truth to their mother.
Back in the present, Lucy discovers that Sara and Georgie’s gravestone has been replaced by one for Frederick Percival Blunden, the “Good Shepherd” who died to save the children. Jamie awakens and learns that their mission was a success. The lawyer Mr. Clutterbuck arrives with recently discovered documents showing that Sara Latimer married Thomas and that their great-grandson is the late Mr. Allen, making Jamie the rightful heir to Langley Park. In a final twist, a car pulls up and Mr. Blunden is inside, greeting them with the enigmatic line, “We three kings of Orient are,” a clue that answers all their lingering questions.
The film closes with the cast saying goodbye to the audience as their names appear on-screen, leaving the viewer with a sense of closure about the intertwined fates of Langley Park, its spectral past, and the living Allen family.