If the new espionage thriller, “Beirut,” seems a tad dated in manner and approach, it might be because Tony Gilroy, he of Jason Bourne fame, wrote the script more than 25 years ago. But in chipping off the rust and applying a fresh coat of 21st-century technology, director Brad Anderson unveils a twisty-turner with all the irresistible trappings of a Reagan-era John le Carre novel.

It’s set largely in Lebanon, circa 1982, but just as easily could be modern-day Syria, itself a victim of a brutal civil war in which cities have been reduced to rubble and the populace sent racing toward the border or the grave. Thrust into this chaotic madness is Jon Hamm’s former diplomat and current Boston-based labor mediator, Mason Skiles. His presence in Beirut is requested by Reagan and his shadowy associates who want him to negotiate a prisoner swap between the CIA and the PLO.

As is the way with this genre, Skiles initially balks, than reconsiders; otherwise we wouldn’t have a movie. His reservations are understandable, considering what he lost a decade earlier when he worked at the U.S. embassy in Beirut. Back then, the city was a Mediterranean paradise with gleaming buildings and beaches — not to mention, rich, beautiful people. So, imagine his surprise when he steps off a plane and sees nothing but bombed-out buildings, heavily armed militia and a palpable fear of death lurking around every corner.

Anderson (“Next Stop Wonderland”) displayed a real knack for this kind of shoot-or-be-killed skullduggery with his last — and biggest — hit, 2008’s “Transsiberian.” Like that minor classic, “Beirut” is overflowing with duplicitous characters harboring unsavory motives. In many ways, it supports President Donald Trump’s accusations that our nation’s intelligence agencies are brimming with nefariousness. In other words, trust nobody — not even a sexy CIA “minder” like Sandy (“Gone Girl’s” Rosamund Pike) — which is Skiles’ plan.

Pike is terrific, but you rue her being stuck with what amounts to little more than “the girl” part, which leaves her with little to do. At least she’s not as over the top as Dean Norris and Shea Whigham as shifty-eyed spooks or Larry Pine as the see-nothing, know-nothing U.S. ambassador. Each has his own agenda, as does Skiles. If you’re looking for a lick of honesty, you’ve come to the wrong place.

While the politics are trite, the action and suspense are top-notch, as you’d expect from the writer of the Jason Bourne films. There are at least half-dozen nail-biting sequences, each better than the last, leading up to a climactic showdown you’ve long seen coming.

Hamm, scrambling to find a worthy part since the departure of “Mad Men,” wears his role as a smart manipulator — and part-time alcoholic — like a glove, always making you believe he’s the smartest spy in the room. Pike isn’t far behind, making the sexist way (remember, this was written in 1991) her character is imagined, go down easier than you’d expect. She brings the type of grit and ingenuity to the part you wouldn’t mind seeing in a female 007. Yes, she’s that cool and smooth.

As for the screenplay, Gilroy’s approach is to keep the politics at a minimum, so you’re level of knowledge about the 20-year Lebanese civil war — and the various religious factions fighting it — probably won’t have an influence on how deep an attachment you’ll form. Just know Hamm is the good guy — or, as good as a bitter, grudge-carrying alcoholic can be — and the rest are more untrustworthy than Ben Carson and Scott Pruitt with an expense account.

That includes the natives, who aren’t rendered with what you’d consider political correctness. Again, this was written nearly three decades ago. What does gnaw at you is the realization that in the years since 1982, nothing much has changed in the Middle East. Some country always seems to be at war. Here, it’s Lebanon. Now, it’s Syria. Ten years ago, it was Iraq. When will it end? “Beirut” persuasively suggests it might well be never.

“Beirut”
Cast includes Jon Hamm, Rosamund Pike, Dean Norris, Shea Whigham and Larry Pine.
(R for language, some violence and a brief nude image.)
Grade: B