Childish misunderstandings produce dire consequences in “Atonement,” an achingly poignant melodrama whose title’s significance doesn’t hit home until the final minutes. Based on Ian McEwan’s novel, the story is awash in tragic romance, the kind where lovers are at the mercy of cruel fate as minor events change the course of their lives.

It begins on a hot summer day in 1935 at the Tallis estate in England. Thirteen-year-old Briony Tallis (Saoirse Ronan), a bossy and precocious writer, is trying to corral her cousins into performing a play she’s written for the evening’s entertainment, as her older brother and a friend are visiting from London. But the kids are more interested in swimming. Everyone is listless and deflated, the way lazy summer afternoons often make us.

From her bedroom window, Briony sees her older sister, Cecilia (Keira Knightley), out on the lawn, talking to Robbie Turner (James McAvoy), the housekeeper’s son. Is there a flirtation there? Later Robbie asks Briony to deliver a note to Cecilia, which Briony reads and misconstrues. Briony subsequently finds Cecilia and Robbie in the library together, engaged in some rather compromising behavior. When a truly nefarious deed is committed later that evening, Briony tells the police it was Robbie. She saw him do it — or, at least, she put two and two together and determined the answer must be four.

Joe Wright (2005’s “Pride & Prejudice”) directs these early scenes with great tension and energy, and just a dash of humor. Robbie does something silly while composing his note to Cecilia, and yet that small, careless act has far-reaching consequences. I marvel at the way Wright conveys both sides of it: it’s a dumb thing, and it’s also a hugely important thing. It’s both. Life is like that, isn’t it?

The story jumps ahead a few years to World War II, with Robbie fighting in northern France and going a bit nutty from the war. Cecilia, a nurse, has never forgiven Briony for her false accusations all those years earlier. Briony (now played by Romola Garai) is in training to be a nurse herself, and she longs to undo the terrible wrongs she committed. But is it too late? And whom does she really want to placate anyway — those she harmed, or her own conscience?

With gorgeous photography by Seamus McGarvey (“The Hours”) and a beautifully emotive musical score by Dario Marianelli (“Pride & Prejudice”) — not to mention the lovely period costumes and all the other accoutrements of tragic romances — “Atonement” strikes almost all of the right chords. Furthermore, an astounding 5 1/2-minute scene on the beach of Dunkirk, all captured in one shot, cements Wright’s status as a director with marvelous technical proficiency.

It is a very good movie, if not a great one. James McAvoy, overshadowed in “The Last King of Scotland” by Forest Whitaker’s more noticeable performance, should get more attention here, as his Robbie is the real protagonist of the film, and an expressive and sensitive character to boot. On the other hand, Keira Knightley, though no slouch in the acting department, is curiously unremarkable as Cecilia. The character is consigned to a fate worse than death for movie heroines: waiting and pining for the man she loves.

B+ (2 hrs., 3 min.; R, some strong sexuality, a lot of harsh profanity, some war violence and hospital gore.)