Tom Hanks in Captain Phillips.

Tom Hanks stars in another real-life-event film in which his character is stuck in a small, dangerous space for a long time—and we know how the story turns out.

Even though most of us know how Captain Phillips will end, Hanks and director Paul Greengrass (The Bourne Ultimatum, United 93) somehow make the story suspenseful. As he did in Apollo 13, Hanks makes us terrified and confused for his character. (If you somehow don’t know the outcome of the true story, go see the film, and be doubly frightened.)

Hanks plays Richard Phillips, captain of the Maersk Alabama cargo ship. While on its way to Kenya in 2009, his ship encounters Somali pirates who try multiple times to board his ship. They eventually succeed, putting into play a crazy hostage drama that results in Phillips being taken aboard a space-capsule-sized lifeboat with his captors.

In every stage of the thriller—from the moment Phillips spots the pirates, through his initial face-to-face confrontation with them, and into the search for the hiding crew members—Hanks is masterful. His Phillips maintains a certain level of calm and smarts, but isn’t superhuman or oblivious to the terror of his situation.

Augmenting the story with a terrifying yet somehow sympathetic performance is Barkhad Abdi as Muse, the pirate leader. One of the major strengths of this film is the relationship between Phillips and Muse—one that starts with Muse informing Phillips that he is no longer the captain of his own ship.

Without necessarily portraying Muse as a victim, Abdi’s performance and Greengrass’ direction hint that Muse is being forced into his reprehensible actions. We first see Muse in Somalia as he’s being bullied into action by a village elder who tails him in a bigger boat and seems to be suggesting dire punishment if Muse doesn’t comply with hijacking plans to extort millions from the Americans. Whether or not this is a true account, it definitely makes Muse a more-fleshed-out character. As for the interplay between Abdi and Hanks, it is chilling, fraught with tension and always on the edge of explosion.

In the supporting cast, Michael Chernus distinguishes himself as chief mate Shane Murphy. You might recognize Chernus from his geeky-guy role in Men in Black 3. This time out, he’s asked to show the dramatic goods, and he comes through nicely. Catherine Keener shows up in the first scene as Phillips’ wife, and then disappears completely. We don’t get any scenes of her biting her nails while awaiting word about her husband’s fate.

The movie seems to be a fairly accurate representation of what actually happened, although some crew members of the Maersk Alabama have taken issue with Phillips’ account in his book, A Captain’s Duty, on which the movie is based. Some of them are saying Phillips acted irresponsibly, ignoring warnings to stay at least 600 miles off the Somali coast due to pirates in the area, and not following proper procedures when the pirates boarded his ship.

Taking all this into consideration, the story in the film remains engrossing, with Greengrass keeping the action realistic and believable. Film buffs might be relieved to know that Greengrass and his crew are relaxing a bit with the shaky-cam, something that got a little tiresome in his Bourne movies. Yes, there’s some shakiness, but nothing that distracts from the action.

Hanks delivers the role in a sort of strange Boston accent that I had a hard time identifying. It’s not all that distracting, really; just pretend his character is Australian, and you’ll be OK. He’s so good here that he can butcher an accent and still be worthy of an Oscar nomination.

Captain Phillips is playing at theaters across the valley.