Tom Selleck has gone from Magnum, p.i. to his magnum opus.

Displaying gritty glamour and flinty charm in Monte Walsh, Selleck would be right at home in Lonesome Dove. His ingratiating performance as the title character evokes memories of Robert Duvall and Tommy Lee Jones in the beloved miniseries.

Credit the inspired influence of Lonesome Dove director Simon Wincer, who guides Monte Walsh and its star with bittersweet affection. The hugely entertaining remake of a 1970 Lee Marvin film premieres Friday on TNT.

For a long time, the 21/2-hour western moseys along, favoring character and atmosphere over rip-snorting action. The movie, based on a novel by Shane author Jack Schaefer, delivers a full-blooded portrait of cowboy life in the 1890s Wyoming Territory.

Along with the bunkhouse brawl and easy camaraderie come the grueling chores and a hideously stinky cook. As civilization encroaches on the frontier, the cowboys must contend with unsteady work, corporate owners, spreading fences and dwindling options.

The harsher aspects make this an adult film, as does Monte’s easygoing relationship with the prostitute Martine (Isabella Rossellini). The episodic comedy-drama offers a simple plot: Monte and his pals scramble to get by.

Still, Wincer draws on a superb cast, a witty script and gorgeous scenery (Calgary plays Wyoming magnificently) for the lush, $12.5 million film. If the director overdoes the cowboys-are-doomed symbolism a bit, he still has the crusty actors to put across that theme.

Keith Carradine nicely matches Selleck as Monte’s closest friend, a sarcastic veteran who realizes the cowboy life cannot go on forever. As a grizzled rancher, William Devane deftly defends the cowboys’ way of life: “All they got is freedom and pride, keeping their word and looking out for one another.”

Character actor James Gammon excels in his brief scenes as an amiable codger. William Sanderson of Newhart supplies comic spice as the foul cook. CSI star George Eads struts convincingly as the cocky upstart who challenges Monte’s position as bronco buster.

The smallest roles have been cast with care: Barry Corbin as a shopkeeper, Wallace Shawn as a Wild West showman and John Michael Higgins as a city-slicker accountant.

This is Selleck’s showcase, and he has never been better. It’s no surprise that he handles the tart comedy with finesse. “Needling people is what I do,” Monte says.

But the aging Monte also requires pathos, and the actor comes through with a heartfelt performance. The love scenes with Rossellini are tender, and her passionate acting stirs memories of her mother, Ingrid Bergman.

Selleck plays stubborn integrity with winning style. “You can’t have no idea how little I care,” Monte says more than once.

Viewers, however, are likely to care. When Selleck and Wincer teamed two years ago for Louis L’Amour’s Crossfire Trail, it became the highest-rated movie ever on basic cable.

That film was a delirious delight, with a bride who spat on her groom and a sheriff who walked away during a gunfight. Selleck and Wincer play it straighter this time out, but that’s no complaint. You’ll get your yee-haws and a few tears too from Monte Walsh.

Hal Boedeker writes for the Orlando Sentinel, a Tribune Co. newspaper.