Deep space was where Christopher Nolan boldly chose to go for his last feature, “Interstellar” (2014). Now he has aimed for shallow waters. Most of “Dunkirk” is set on and off the beaches of northern France, close to the Belgian border—a perilous place to be, in late May and early June of 1940. The British Expeditionary Force, dispatched to France in the fall of the previous year, had been forced into an inglorious retreat. The result was that a multitude of Allied troops were stranded in and around the town of Dunkirk, waiting at the sea’s edge to be rescued. For prowling German aircraft, they were easy prey. Thankfully, salvation did arrive, in the shape not just of the Royal Navy but also of a flotilla of small vessels—the Little Ships, as they came to be known, some seven hundred strong—that had been summoned to the fray. Eventually, in what Churchill called “a miracle of deliverance,” more than three hundred thousand men made it back to England.

This saga is an unlikely candidate for a major Hollywood production, especially one written and directed by the maker of the “Dark Knight” trilogy. It’s hard to think of a more parochial tale. Dunkirk is stitched into the British mythology of the Second World War and, even now, occasional mention is made of “the Dunkirk spirit,” yet the legend has never travelled far, and for obvious reasons. Operation Dynamo—the code name for the evacuation—was not a victory but a barely averted catastrophe, and it came on the heels of what Churchill himself, in the House of Commons, lamented as “a colossal military disaster” in Belgium and France. Many countries, preferring straightforward triumphs, would have swept such an episode under the rug with a mixture of embarrassment and relief. Something about Dunkirk, though, appeals to the peculiar British love of the gallantly narrow squeak, and, in the deployment of the Little Ships, to an abiding fondness for the doughty and the makeshift. You can understand Nolan’s interest; born in London, in 1970, he belongs to what is probably the last generation to have been reared on the rousing fable of Dunkirk. Why on earth, however, should he want to spread the word?

A clue to this puzzle comes early in the film. Up onscreen appear the phrases “1. The Mole,” “2. The Sea,” and “3. The Air.” They introduce us to the three narrative strands that will wind through the next hundred minutes or so; notice the hint of the elemental. The Mole refers to a concrete jetty jutting into Dunkirk Harbor, whereas the air is the domain of a Spitfire pilot (Tom Hardy). When we first encounter him, he is already aloft, in a formation of three. Never do we discover which squadron he belongs to, or what sort of life he has left behind on the ground. For the most part, all that we see of him is his goggled eyes; not until the finale are we shown the rest of him, and only in the ensuing credits do we find out that he is called Farrier. It must have taken Hardy almost an entire morning to learn his lines, which seem even sparser than his dialogue for “Mad Max: Fury Road” (2015), although, as we know from that masterwork, the less we hear from him the tighter our grasp of his character, and the greater the powers that seem to be held in check. At one point in “Dunkirk,” Farrier, low on fuel, is faced with a choice: pursue a German bomber that is harrying a warship crammed with evacuees, or turn tail and head for home before the tank runs dry? He says nothing, but those eyes reveal all. We follow his thoughts as clearly as we do every tip and tilt of his wings.

No such clarity below. Men are lined up on the shore, hoping to get onto one of the ships that dock in the harbor, but a sullen quiet prevails; the next bomb could shred and scatter them, and they cannot predict where it will hit. Shouldering through the crowd are a couple of young British soldiers with a stretcher, who are trying to get one of the wounded on board—and maybe, in the process, sneak a berth themselves. Gradually, one of them, Tommy (Fionn Whitehead), gains a foothold in the drama, though you couldn’t call him the hero, for there is no main character in “Dunkirk.” Instead, various figures move onstage and off: Commander Bolton (Kenneth Branagh), who oversees the embarkation; Alex (Harry Styles), a fellow-evacuee whom Tommy meets halfway through; and a numb and nameless man (Cillian Murphy) found shuddering on a capsized hull. Silent at first, he eventually mutters, “U-boat.”

Meanwhile, out in the English Channel, and heading to Dunkirk, is the Moonstone, skippered by Dawson (Mark Rylance), her owner. (In truth, the majority of Little Ships were requisitioned for the voyage across, but there were exceptions, and that is why Dawson casts off just before the uniformed authorities can reach him.) He recognizes a Spitfire from its growling thrum overhead, without having to glance up. “Rolls-Royce Merlin engine,” he says. “Sweetest sound you could hear out here.” He is no more voluble than the rest of the folk in this film, who seem either stunned by events or taut with determination, but Rylance, as ever, conveys a vigor of spirit through the simple crispness of his gestures. He removes his jacket on departure, and, throughout the ordeal, wears a white shirt, a tie, and a sweater, as if he were doing a bit of Sunday gardening rather than hauling a shoal of his countrymen, half-drowned and drenched in oil, from the unfriendly waves.

How to account for the impact that is made by “Dunkirk”? After all, there are so many ways in which the film falls short, and so many directions in which Nolan decides not to tack. Anybody wishing to understand the niceties of Operation Dynamo will be confounded, as will anyone expecting the sight of high-ranking strategists huddled around maps in low-lit situation rooms. (We do hear one of Churchill’s speeches, but only when a young man reads it aloud from a newspaper.) Nor does the film convince as a period drama. Most of the soldiers, who should look pinched and ration-fed, are well nourished, handsome, and unmistakably modern specimens—oddly well spoken, too, and lacking that earth-dark humor with which combatants everywhere seek to lighten their load and to wrestle down their dread. Most anachronistic of all are the tears that cloud Bolton’s eyes at the approach of the Little Ships. As a rule, senior officers, tasked with the mass relocation of men, have neither the time nor the inclination to weep.

Yet the movie works. Time and again, the action swells and dips, like a wave, then suddenly delivers a salty slap in the face. From above, we see a pilot ditching his damaged Spitfire in the sea, and the procedure runs smoothly; later, another flier does the same, and we stay with him as he lands. A tumult of water rushes toward him and fills the cockpit at alarming speed, while he batters on the canopy above, which refuses to slide open. Smoothness, viewed from another angle, collapses into the roughness of panic. Likewise, we join a throng of rescued men, belowdecks on a naval vessel, who are served bread and jam and—as in every moment of crisis, this being a British enterprise—mugs of tea. Then a torpedo hits. All becomes darkness and deluge. Humans turn into creatures of the deep. A pale hand flickers like a fish.