What a treat it is to see 77-year-old Peter Fonda in “The Ballad of Lefty Brown” in full Western gear as one Edward Johnson, sporting a glorious 1880s beard, his eyes bright and focused enough to see halfway across Johnson’s beloved (and newly minted) state of Montana.

Fonda comes close to impersonating John Wayne without actually imitating the Duke, but the resemblance and the mannerisms and the larger-than-life persona — unmistakable.

The rancher and gunman Edward Johnson has just been appointed as a United States senator from Montana, and soon he’ll be on his way to Washington, D.C.—but he still lives by the “rules” of the Old West, so when a gunfight breaks out over a $2 dispute at the poker tables, the man who wronged Edward finds himself with a noose wrapped around his neck. Judge and trial be damned.

In many ways, ”The Ballad of Lefty Brown” is a traditional Western — but you’ll note writer-director Jared Moshé’s film isn’t titled “The Ballad of Edward Johnson.”

This is a Western that places the sidekick front and center, and in doing so gives reliable everyman supporting character actor Bill Pullman a rare chance to carry the film, and what a fine job he does with the added responsibilities. Early in the story, we leave Edward Johnson behind and we stay with Lefty Brown.

Pullman’s Brown is the classic Western sidekick. He walks with a limp, courtesy of a bullet he took in his leg as a young rabble-rouser. He says, “I reckon” a lot, and sometimes has trouble expressing himself beyond that, stopping mid-sentence to wait for the words to come to him, as Lefty puts it. For 40 years, he’s been happy to walk and ride in Edward’s shadow.

Lefty prides himself in being loyal to Edward, but as Edward’s straight-talking wife Laura (Kathy Baker) says to him, “Loyal ain’t the same as capable.”

When Lefty sets out alone to find a band of no-good horse rustlers and killers, we know he’s going to pick up a few partners along the way. (It’s not really a posse if it’s a one-man posse, right?)

It’s not long before Lefty teams up with Jeremiah (Diego Josef), your typical green but eager gunman who actually carries around a collection of (often embellished) tales of the Old West, some featuring the great Edward Johnson himself. (To Lefty’s chagrin, he’s not in the storybook, but remember: He’s a sidekick. They didn’t write dime novels about the sidekicks.)

As wide open as 1889 Montana is and even without Facebook or texting or GPS, it’s not long before Lefty also runs into one Tom Harrah (Tommy Flanagan from “Sons of Anarchy”), who ran with Edward and Lefty back in the day, crawled inside a bottle after his wife was assaulted and murdered, and is now sporting a marshal’s badge. Tom reluctantly joins the hunt for the bad guys.

The pulpy screenplay is filled with lines such as, “Sorry don’t get it done,” and, “You got a bullet in you that’s gotta come out.” Writer-director Moshé is obviously a fan of the Howard Hawks/John Ford playbook.

At times we barely make out Pullman’s face beneath the tilt of his hat and the bushes of his facial hair, but his trademark squint shines through, and he puts tasty spins on his dialogue delivery, sometimes going so high with his voice we expect a window to shatter.

Jim Caviezel also amps it up as the governor of Montana, a handsome, dashing figure with his sights set clearly on the future — and if some blood is shed in the march to progress, so be it. Kathy Baker is the quintessential Strong Western Wife, who has stood by Edward through nearly half a century not as a meek little woman, but as his partner in life.

“The Ballad of Lefty Brown” was shot in Montana, to breathtakingly glorious effect. Just about every night, there’s the type of sunset that will get a cowboy thinking about riding right off into it.

★★★

A24 presents a film written and directed by Jared Moshé. Rated R (for violence and some language). Running time: 111 minutes. Opens Friday at AMC River East.