Tom Hanks isn’t too worried about spoilers when it comes to Captain Phillips.

The new movie’s ripped-from-the-headlines plot is based on the 2009 hijacking by Somali pirates of a U.S. cargo ship, and in the end, the hero lives to see another day (and to write a book, A Captain’s Duty, which served as the basis for the film).

So with that out of the way, the star can talk freely about Captain Phillips’ final scene, in which Richard Phillips (Hanks) — having been rescued after a relentlessly tense standoff with the pirates — is brought to the sick bay of a Navy destroyer, bloodied and exhausted. As a female corpsman performs her checks of his physical condition, he completely surrenders to emotion, awash in a type of powerful catharsis rarely seen at the end of Hollywood thrillers.

Before examining his bravura scene, however, it’s helpful to have some context. So here it is:

Director Paul Greengrass shot 75 percent of Captain Phillips over 60 days on the open water. Filming took place off the coast of Malta on a Maersk vessel identical to the one hijacked; on a fiberglass lifeboat identical to the one on which the pirates held Phillips hostage; and on a mission-ready guided missile destroyer near Norfolk, Va.

“It’d be silly to do it any other way,” said Hanks, seated at a table at The St. Regis Atlanta, looking younger than his 57 years with a short haircut and Ray-Ban eyeglasses. “The smell and the tactile effect of actually being at sea and having to deal with all of the nature of that — and also the sound and the smell and the hardware of the ship itself — we didn’t have to pretend. If our job is to pretend we’re operating in real time and real space, it makes sense therefore to actually — if you can — well, be in real time, be in real space. It’s gonna help you out.”

Greengrass, director of the kinetic second and third Bourne movies, also is known for his skill with docudramas such as 9/11 thriller United 93 and Bloody Sunday, a dramatization of the Irish civil rights protest and massacre by British troops in 1972. For United 93, he famously shot on a real Boeing 757 and had some participants in the real-life events — the FAA’s operations manager — play themselves.

“Movies are not journalism, and they’re not history,” Greengrass said. “But I really do believe that there are truths about what it feels like, what the experience would feel like.” Shooting in real places with real people, he said, “can put you in the experience. It can show you a bit of the world with some authenticity.”

And so late in the afternoon on a day toward the end of the shooting schedule, aboard the USS Truxtun, Hanks and Greengrass were searching for that moment of emotional release.

In the screenplay, Phillips breaks down alone in the captain’s quarters, after having showered and been given a clean uniform.

“It made sense, and it was there, and it was fine,” Hanks said. “We thought, in the context of the movie, it’ll all work out.”

But, Greengrass said, “It never felt I think to either of us that it was quite transcendent.”

Greengrass found himself during a break talking to Frank Castellano, the commander of the Navy destroyer during the actual hijacking. He told Greengrass that the first place Phillips was taken after being recovered was the infirmary.

Their time on the boat was running out, but Greengrass was intrigued. So the crew hurriedly moved equipment down to the tiny sick bay, where Navy Hospital Corpsman Danielle Albert was on duty. Greengrass asked her if she would be willing to be on camera.

He told her: “This is a scene where Phillips has just been rescued. I just want to know what you would do if you were on that ship. (Treat it) exactly like a training exercise. Just ignore the fact that he’s Tom Hanks.”

She agreed — then proceeded to let her nerves blow the first take.

“Those people, they didn’t even know they were gonna be in a movie that day,” Hanks said. “So we just took a brief moment, and said, ‘You didn’t do anything wrong. This happens all the time. If you’re worried about making a mistake, forget it. Just go through it, and if it’s great, it’ll be used, and if not, you don’t have to worry about it.’”

In about 40 minutes, they did four takes - “but most of what’s on screen is the second one,” Greengrass said.

What’s on screen, exactly? One of the most indelible performances of a two-time Academy Award winner’s career, aided by the presence of a young female corpsman performing an examination so realistically, it feels like you’re watching a documentary.

Truxtun commander Andy Biehn was standing with Greengrass outside the sick bay watching that second take unfold on a monitor, the director recalled. “Afterward he said, ‘I’ve seen some trauma in my time, and that’s absolutely what it looks like.’”

“I wouldn’t even know how to explain it,” Hanks said when asked how he got to that place emotionally as an actor. “It wasn’t at the exact end of (shooting) the movie, but we were near the end, so there was an awful lot of firewood in the fire, and then you - man, you just let go.

“That was actually a free scene that wasn’t in the script. So there was no preordained pressure. It was kind of like, OK, we can shoot here, let’s see what happens. And that’s what happened.”