“Bandits” is a cheerful movie in which lovable outlaws are the protagonists and law enforcement agencies are practically non-existent. It is tempered by an underlying sense of doom, as we are told up front that our heroes died in a hail of bullets while robbing a bank. The movie is about what led to that fateful heist, and the more we get to know these guys, the sadder we are to remember what we’ve been told.

And yet it is not a sad movie, for reasons I cannot fully explain here without spoiling it. I will say, however, that no journey with Bruce Willis, Billy Bob Thornton and Cate Blanchett could ever be too unpleasant, especially with each one performing so admirably well.

Willis and Thornton play Joe and Terry, bank robbers recently escaped from Oregon State Prison. To avoid alarms, customers, employees and other robbery-foiling elements, they begin showing up at bank managers’ homes the night before, staying overnight, and going to work with them the next day. They collect all the money before the bank even opens, and no one gets hurt. They are assisted by Joe’s mildly competent cousin Harvey (Troy Garity), who wants to be a stuntman.

Their goal is to make enough money to flee to Acapulco, despite Terry’s “sanitation issues” with the place. Unfortunately, they acquire a woman named Kate (Cate Blanchett), a bored housewife who is something like a hostage but more like an accomplice, and soon she is the love interest of both bandits.

The screenwriter is Harley Peyton, who also wrote several “Twin Peaks” episodes. The script is predictably loopy, with all characters capable of having conversations while operating on completely different wavelengths. Non-sequiturs abound, including Terry’s exclamation of “Beavers and ducks!” upon being awakened, and Harvey’s comment that “the thing about Irish hurling is that it’s like football with sticks.”

Thornton is endearingly funny as mega-hypochondriac Terry. His long list of phobias includes antique furniture and Charles Laughton. He gives cooking tips to the wife of one of the bank managers he’s robbing. It’s a jokey character — as are they all, really — but it works because of a sensitive performance. If actors don’t love their own characters, the audience won’t either, but that’s not the case here. The cast is eager to portray these people as quirky, yes, but still realistic and likable. I particularly enjoyed Kate’s love for cheesy pop songs like “Just the Two of Us” and “Total Eclipse of the Heart.”

Director Barry Levinson maintains an even pace, which is critic-speak for “sometimes it’s too slow.” Not often, but enough to notice it. It all leads to one of the most wonderful endings of the year, however. Don’t miss this delightful movie.

A- (; PG-13, a few profanities, some fairly mild.)