The R-rated superhero movie has arrived, just as they said it would after Marvel’s “Deadpool” became a $780-million hit. That movie was a comedy, but the latest example of the genre, James Mangold’s “Logan,” is anything but. “Logan” presents everyone’s favorite X-Man, The Wolverine, in such a serious and grown-up light that the film takes a little getting used to.

“Logan” finds its titular hero, he of the mutton-chop sideburns and knuckle-based knives, in the twilight of his years. The sight of his graying hair and sagging skin is a shock, as is the opening-credits beating he takes from a bunch of second-rate car thieves. We’re told the X-Men in general are over: No new ones are being born, and even the once-proud Professor Charles Xavier (an excellent Patrick Stewart) is now a sick man babbling away in a grimy bunker. All they want is enough cash to buy a boat and die anonymously at sea.

advertisement | advertise on newsday

Where are the snappy one-liners, the midair fistfights, the sexy costumes? Not here. Mangold (“Cop Land,” the 2007 remake “3:10 to Yuma”) approaches “Logan” like a Western — specifically, the kind whose hero is an aging gunslinger. When Logan stumbles upon an orphaned little girl named Laura (Dafne Keen) who seems to be the first superhero in a generation (hey, she has knuckle-blades, too? Hmmm), he’s moved to help her only by the promise of money. Classic Westerns like “True Grit” and “Unforgiven” come to mind, while “Shane” becomes little Laura’s favorite film.

It’s fascinating to see a Marvel movie strike such a rugged, gritty, hard-nosed tone, but “Logan” can’t keep it up consistently. Its main villain, Pierce (Boyd Holbrook), is a comic-book sleazeball with sunglasses and a metal hand; the action scenes look noticeably computer-aided, with blurry red splatter; and there’s a plot detour involving a friendly African-American family that strikes all the wrong notes. Hugh Jackman is quite good in this Eastwood-ized version of Logan — the surly old lion — but the script, co-written by Mangold, forces him into a final moment of gooey sentiment that mars the whole movie.

That said, “Logan” provides a fitting finale to the Wolverine franchise. It isn’t often a Marvel superhero gets to saddle up, tip his hat and ride off into the proverbial sunset.