Logan is the kind of movie that restores my faith in superhero action films. The story is layered, the characters have defined arcs, and the suspense keeps the audience engaged. Its R rating is well earned, with gruesome violence and disturbing situations involving children. The Hunger Games looks like a playground dust-up compared to what the mutant children in Logan deal with—and respond to in kind.

The violence may seem gratuitous to some viewers, but mostly it serves the purpose of the story. James “Logan” Howlett is the mutant Wolverine of Marvel Comics fame, and his personality is volatile and emotional. He also has a conscience. These dimensions—including the guilt that comes with the curse of having steel claws that decapitate, impale, and slash his attackers—are portrayed well by Hugh Jackman (his ninth movie performance as Wolverine). Logan’s mutant powers are used defensively, not offensively. The violence is not portrayed as honorable or noble, and this becomes an integral part of a very thoughtful film.

The story picks up on the tail end of a purge of mutants in a somewhat dystopian America of 2029. Logan is holed up in an abandoned factory, just over Texas’s border with Mexico, caring for Charles Xavier, a.k.a. “Professor X” (Patrick Stewart, Star Trek: The Next Generation), and assisted by the albino mutant Caliban (Stephen Merchant). Both Logan and Xavier are dying. Logan has been poisoned by the adamantium alloy fused into his bones to make his claws. Professor X is suffering from a degenerative neurological disease that unpredictably unleashes devastating telepathic powers.

Meanwhile, the evil global corporation Transigen is tracking down all the remaining mutants and replacing them with the new X-24 breed cloned from the DNA of first-generation mutants. The program is run by Transigen’s brilliant if authority-hungry surgical head Zander Rice (Richard E. Grant, Bram Stoker’s Dracula, The Iron Lady, Jackie), whose father was killed by Logan at the end of X-Men: Apocalypse. Assisting Rice are the “cyber-enhanced” (non-mutant human) chief of security Donald Pierce (Boyd Holbrook, Milk, Gone Girl) and a small army of cyber-enhanced “enforcers” called “reavers.”

Xavier, Logan, and Caliban live below the radar until Gabriella (Elizabeth Rodriguez, Orange is the New Black, Fear the Walking Dead), a former nurse for Transigen, tracks them down in an effort to save 11-year-old Laura (Dafne Keen, The Refugees), part of a new generation of X-23 warriors cloned from mutant DNA. Gabriella implores Logan to transport Laura to safety in Canada. Transigen, having determined that the X-23 children were too hard to control, had killed them after another breed of mutant, the X-24, was perfected. Gabriella sees the humanity in the children and helps several to escape, but Laura is the only one who makes it to Logan’s compound. Gabriella also reveals that Laura was cloned from the DNA of Logan and thus is his daughter.

In the hands of a lesser filmmaker, the father-daughter twist could easily have been nothing more than a cinematic cliché. But in the hands of writer-director James Mangold (Walk the Line, Girl, Interrupted, 3:10 to Yuma) the revelation becomes central to the film’s psychological theme: how violence affects the human mind. Logan’s relationship with Laura rekindles a fundamental humanity in him. The real story, however, is his role in teaching the undisciplined, intense, and volatile Laura the value of preserving life rather than taking it. Logan’s internal torment is driven by his guilt from having killed people, not all of whom were evil. Teaching warrior Laura a moral lesson—the dangers and responsibilities that come with her mutant powers—provides Logan with a path to redemption as he grapples with his own impending death.

As his healing powers weaken and his life grows increasingly precarious, Logan experiences his humanity resurfacing long enough for him to awkwardly but effectively teach Laura the value of life. Dafne Keen’s portrayal of Laura is riveting and compelling. The young actress convincingly shows us how Laura evolves, from a darkly unstable and violent warrior into an inquisitive and contemplative child who has genuinely bonded with Logan. Mangold deftly uses Laura’s Spanish-English bilingualism to pull back the layers of her character and eventually reveal her complexity and compassion.

Through Logan’s torturous self-loathing from having blood on his claws, the film shows how violence traps and degrades humanity. But it also imparts a hopeful vision, by showing Laura’s growing understanding of the value of human life and connection to her father. This message is not just one of many interpretations of the events unfolding on the screen—it is unavoidable. As the mutant children make their way to Canada, Laura quotes the 1953 western movie Shane. “A man has to be what he is, Joey,” says Shane to the young boy who idolizes the gunslinger turned protector.

“You can’t break the mould... I tried it and it didn’t work for me.... Joey, there’s no living with a killing. There’s no going back from one. Right or wrong, it’s a brand. A brand sticks. There’s no going back. Now you run on home to your mother, and tell her...tell her everything’s all right and there aren’t any more guns in the valley.”

Logan is a superhero action film with soul. It provides entertaining escape, but it also provokes meditations for viewers hoping for more depth.