“Logan” is such a spectacularly good surprise. Combining shocking, R-rated action and somber themes, it’s the sort of grueling movie one watches with mouth gaping and face rapt. This is a bold, coherent story inspired by a comic book, not slavishly based on it.

The title sets the stage by avoiding an X-Men alias for a more-realistic given name. Hugh Jackman, whose powerful performances as Wolverine turned the mutant with retractable metal claws into a cult object, gives a deep reading of the character as he would be in 2029. Having lived almost 200 years as a physically fit monster immune to injury and pain, he has aged into grizzled vulnerability and mortality.

When he steps into view in the ankle-height opening sequence, he doesn’t strut with confidence, and the worn shoes establish a mood of deterioration. He’s not flying in a supersonic aircraft but driving around Las Vegas as a freelance chauffeur. After centuries of physical and emotional injury, Logan isn’t invulnerable anymore.

His time off the roads is devoted to caring for his mentor, Prof. Charles Xavier (Patrick Stewart). The benevolent telepath is even more enfeebled. Unable at times to control his psychic powers, he has been declared a “weapon of mass destruction” by the government.

Executive orders that classify mutants as a security threat have sent seismic tremors through the community. The mutant population has fallen to near-invisibility as ever fewer new mutants are born and SWAT-style police squads capture those remaining wherever they hide. When we encounter them, Logan and the frail Xavier live hidden in a ruined desert annex with his psychic caretaker Caliban (Stephen Merchant, deftly trading his comic skills for sharp drama). They are planning — hoping, really — to buy an old yacht and sail away to safety before it’s too late.

The money they need for their getaway might be available from a woman who offers Logan a big payment to transport a mysterious young Mexican girl, Laura (Dafne Keen), to a distant destination. Meanwhile, raiding parties sent by Dr. Zander Rice (Richard E. Grant), an evil eugenic scientist with plans for the near-extinct mutants’ gene pool, stay in constant pursuit.

The somber new chapter in this series offers deep character studies and high-impact action sequences. Logan’s fist sabers are not the only weapons that draw serious blood in carnage that is mind-bending without being mindless.

The film’s conclusion carries an impressive level of emotional significance. It’s earned by a serious focus from the opening, with no light comedy cameo by Marvel maestro Stan Lee to undercut the sustained tension. With a spirit of melancholy farewell at the finale, this is clearly Jackman’s final turn as the character he created. There could hardly be a better sendoff.

MOVIE REVIEW

“Logan”

Grade: B+

Starring Hugh Jackman, Patrick Stewart and Boyd Holbrook. Directed by James Mangold.

Rated R for brutal violence, profanity and brief nudity. In English and Spanish. Check listings for theaters. 2 hours, 15 minutes.

Bottom line: A bold, coherent story that works as a great sendoff to this character