Damien Chazelle’s glorious and beautiful and alternately operatic and intimate moon-mission film “First Man” is a master class in how to find dramatic intensity in a story with one of the most well-known endings in the history of human adventure.

Spoiler alert! Neil Armstrong was the first person to walk on the moon. This is the story of how he got there, what it took to get him there, and what it felt like once he WAS there.

From an engrossing, full-throttle, dizzyingly visceral opening sequence in which Armstrong pilots an X-15 that dances above the Earth’s atmosphere before coming precariously close to fatally spinning out of control; through the geeky, period-piece, procedural interludes; to the sometimes heartbreaking domestic sequences; to the stunning and breathtaking climactic voyage to the moon, “First Man” achieves authenticity and greatness.

Put it right up there with “The Right Stuff” and “Apollo 13” in the ranks of the best movies ever made about NASA.

Chazelle reteams with his “La La Land” leading man Ryan Gosling, whose onscreen persona is perfectly suited to playing Armstrong, who was passionately committed to the space program and dearly loved his family and had no shortage of self-confidence but was something of a reluctant hero and an elusive public figure.

Sure, Gosling is dashing and has movie star charisma and all that — but he has a natural affinity for playing characters who internalize their feelings, who aren’t big on sharing, who measure their responses before speaking.

And that’s Neil Armstrong.

With the exception of a few well-placed flashbacks, “First Man” travels a linear path covering the eight-year stretch between 1961 and 1969 when NASA mounted a determined, almost frenzied campaign to overtake the front-running Soviets and literally plant the American flag on the moon.

Working from a superb screenplay by Josh Singer (“The Post,” “Spotlight”), who adapted James Hansen’s bestselling book “First Man: The Life of Neil Armstrong,” director Chazelle frequently invokes a hand-held camera, docudrama style, whether the story is focusing on Armstrong’s home life or the camaraderie/competition among the astronauts jockeying for position on a rapid progression of Gemini and Apollo missions.

Gosling expertly captures Armstrong’s methodical, straightforward, guarded and sometimes infuriatingly closed-off approach to everything from problem-solving any and all aspects of getting to the moon to dealing with the horrific deaths of a number of his colleagues to coping with the loss of the Armstrongs’ daughter, Karen, who died of a brain tumor before reaching the age of 3.

Claire Foy’s electric, emotionally charged performance as Janet Armstrong provides a vitally important dramatic counterbalance to Gosling’s cool reserve and gives the movie its heart and soul. While Neil is consumed with the mission (whether he’s at work or working at home), it’s Janet who tends to the everyday needs of their young sons, and it’s Janet who has to keep the family together.

Eyes blazing, Janet demands Neil talk to the boys before he embarks on the historic but tremendously risky mission and let them know this might be the last time they’ll see him — and she’s even more of a force when she calls out NASA supervisors for their “We’ve got this under control” line of B.S.

The partial list of brilliant character actors playing key figures from the space race includes Ciaran Hinds as Robert Gilruth, the first director of NASA’s Manned Spacecraft Center; Jason Clarke as Ed White; Kyle Chandler as Deke Slayton; Corey Stoll as Buzz Aldrin; Shea Whigham as Gus Grissom, and Lukas Haas as Mike Collins.

They have their own stories, their own ambitions, their own agendas, their own paths — but their collective respect and regard for Armstrong the astronaut and Armstrong the rock-solid man enhance our empathy for such a tight-lipped and (for the most part) emotionally inaccessible central character. (At one point late in the story, “First Man” briefly goes unabashedly sentimental and borderline corny, but it doesn’t come across like a grave manipulative offense.)

MORE FROM RICHARD ROEPER

Thrills of Bradley Cooper’s ‘A Star Is Born’ aren’t just musical
‘Venom’: Dumb plot, weak effects sting in inept superhero film

The depiction of Apollo 11’s astonishing journey to the moon in the summer of 1969 is a triumph of filmmaking. We experience much of it through the viewpoint of Armstrong as he and the crew overcome various technical hurdles and execute one tricky maneuver after another, all leading to Armstrong and Buzz Aldrin touching down on the lunar surface, and Armstrong taking that one giant leap for mankind.

“First Man” is an exciting and fresh take on a story told again and again. It’s a through-and-through salute to the American spirit and ingenuity and drive — which makes the pre-release controversy over the absence of a flag-planting scene even more ridiculous.

First of all, we DO see the American flag on the moon in a couple of wide shots. And prior to that, there’s hardly a shortage of visual references to the flag, including a poignant moment when a young boy raises the American flag to start the day.

What makes the movie so memorable, so good, so strong, is the unvarnished, warts-and-all perspective. It pays fitting tribute to the awesome heroics of the first man to walk on the moon while reminding us he was also an ordinary family man whose oldest son reacted to the news of dad’s big mission by asking, “Does that mean you’re going to miss my swim meet?”

‘First Man’

Universal Pictures presents a film directed by Damien Chazelle and written by Josh Singer, based on the book by James R. Hansen. Rated PG-13 (for some thematic content involving peril, and brief strong language). Running time: 138 minutes. Opens Friday at local theaters.