Although “The Old Man & the Gun” is inspired by true events and works as a stand-alone, whimsical, thoroughly entertaining work, there are moments in Robert Redford’s final film as an actor in which Redford almost gives us a sly wink.

When his old-timer Forrest Tucker confesses he’s never been on a horse, but it’s on his bucket list, we have to laugh.

Robert Redford — the Sundance Kid, “The Electric Horseman,” “The Horse Whisperer” — playing someone who’s never saddled up and seems skittish about even trying? Fantastic.

And the hat. Redford is playing a career criminal who keeps on committing crimes, keeps on getting caught — and keeps on escaping. It stands to reason such a guy would wear a hat to keep a low profile, but we can’t help but be reminded of Redford’s stylish sporting of chapeaus in the “The Sting” and “The Natural” et al.

Even the poster, with Redford in mid-stride, his right arm obscuring his famous visage as he adjusts that hat, makes it seem like one of the greatest leading men ever is tipping his cap to us as he walks into the sunset (or over to the director’s chair).

We meet Forrest as he’s exiting a bank with haste but not a trace of panic, briefcase of loot in hand. As Forrest listens to the police scanner on an earpiece (it’s the early 1980s), he sees a woman with a stalled car on the side of the highway — so he pulls over to offer assistance, but really to become invisible to the police who soon will race by. After all, nobody’s going to think that kindly older gentleman helping that stranded lady has just robbed a bank.

Tucker has style. He wins you over with his charm and his grace and his manners. When bank tellers and branch managers and customers are questioned post-robbery, they unfailingly cite Tucker’s polite and gentle ways. Sure, he just robbed a bank — but he was so darn NICE about it.

In fact, Tucker is so low-key he smoothly pulls off a heist right under the nose of John Hunt (Casey Affleck), an off-duty police detective who is a customer at the bank at the time of the robbery, but doesn’t realize what’s happening until it’s too late.

MORE FROM RICHARD ROEPER

Thrills of Bradley Cooper’s ‘A Star Is Born’ aren’t just musical
‘The Sisters Brothers’ saddles up great actors for a new look at the Old West

Of course the veteran cop Hunt is embarrassed and gets the expected ribbing from his colleagues — but thanks to Hunt’s dogged investigative work, authorities come to realize Forrest and his two grizzled accomplices (Danny Glover and Tom Waits, both excellent) are responsible for dozens of bank robberies throughout the Southwest. Who IS this Forrest Tucker guy?

The press dubs Forrest and his sidekicks “The Over the Hill Gang,” but this isn’t another cheesy reboot of “Going in Style.” Writer-director David Lowery (who directed Redford in 2017’s “Pete’s Dragon” and Affleck in “A Ghost Story”) grounds the story in authenticity while also infusing it with stylized touches. The film was shot on 16mm film stock, giving it a wonderfully grainy look. And there are countless neat touches, e.g., a group of kids re-creating a tableau out of Mark Twain, or a nondescript diner becoming the key location for a trio of pivotal scenes.

Remember the woman whose car had broken down? Her name is Jewel, and she’s a widow who owns a horse ranch, and Sissy Spacek plays her, and it is a joy to watch Redford and Spacek in perfect rhythm as Forrest tells Jewel all sorts of stories before finally coming clean about his true identity, which of course is far more unbelievable than anything he could concoct.

And yet Jewel feels more alive with Forrest than she has in a very long while. The quiet, funny, poignant conversations between Forrest and Jewel are lovely and real and poetic without ever seeming overwritten.

Police Detective John Hunt (Casey Affleck, left, with Tika Sumpter) is on Tucker's trail in "The Old Man & the Gun."

Police Detective John Hunt (Casey Affleck, left, with Tika Sumpter) is on Tucker’s trail in “The Old Man & the Gun.” | Fox Searchlight

We also spend a good deal of time with Affleck’s John Hunt, his wife Maureen (Tika Sumpter, doing fine work as always) and their adorable children (real-life siblings Ari Elizabeth Johnson and Teagan Johnson). Even the kids realize John is becoming so invested in the pursuit of Forrest, he might be sad if he actually catches him, because he’s having so much fun chasing him.

To his credit, writer-director Lowery periodically reminds us Forrest, for all his crinkly charisma and all his legendary exploits — I mean, the guy BUILT A BOAT while an inmate at San Quentin and somehow was able to paddle away — was a narcissist obsessed with the thrill of robbing banks and the challenge of escaping from lockup after lockup, and wasn’t all that concerned with how that impacted the people in his life, from his newfound love interest to the family he abandoned decades ago. (Appearing in just a single scene, Elisabeth Moss is brilliant as Forrest’s now-grown daughter, who never met her father and wouldn’t have the slightest interest in seeing him now if he’s caught.)

Still. Forrest Tucker’s swan song moments in “The Old Man & the Gun” are well tailored for Robert Redford’s swan song as an actor. It’s a damn good performance that also serves as a fitting curtain call.

‘The Old Man & the Gun’

1⁄2

Fox Searchlight presents a film written and directed by David Lowery, based on a New Yorker article by David Grann. Rated PG-13 (for brief strong language). Running time: 96 minutes. Opens Friday at local theaters.