Comic book movies aren’t just for kids.

“Logan,” the blood-drenched final chapter in the Wolverine saga, demonstrates that superhero films don’t have to be sanitized to succeed. Like “Deadpool” before it, the blockbuster differentiated itself from the flood of films about costumed heroes by embracing a hard R-rating. It’s no accident that Fox produced both movies. The studio, which licenses the rights to X-Men characters like Wolverine and Deadpool, seems intent on carving out a niche for itself by making grittier, tougher comic book fare that’s in stark contrast to Disney’s sunnier “Avengers” series.

“Fox needs to be bold and continue to blaze this trail,” said Jeff Bock, an analyst with Exhibitor Relations. “I think the world is now ready for an R-rated X-Men film.”

So far, the strategy is working. “Logan” debuted to a massive $237.8 million globally and “Deadpool” ended its run with nearly $800 million worldwide.

“We have a clear direction and audiences are responding to it,” said Chris Aronson, Fox’s domestic distribution chief.

In an interview with Variety’s Kristopher Tapley last week, director and co-writer James Mangold said that he made a pact with Hugh Jackman, the franchise’s star, to lean into the character’s dark side. Logan is a former mercenary who has left a trail of blood in his wake. Like William Munny in Clint Eastwood’s “Unforgiven,” he is haunted by the lives he snuffed out.

“You’re just looking for a way, and I think the studios are too, to just shake things up because everyone feels that there’s a certain amount of exhaustion setting in,” said Mangold, adding, “We can’t keep doing the same movie over and over again.”

Mangold speculated that the world is ready for stories that have more gravity. Unlike “Deadpool,” which plays at time like a parody of the spandex genre, “Logan” is deadly serious. Like “Shane” or “Pale Rider,” it works as both an adventure film and a meditation on guilt and regret. In his talk with Tapley, Mangold argued that after an election that saw Donald Trump upend conventional wisdom by capturing the White House, the entertainment business must find ways to better reflect the chaotic current political climate.

“There was a convulsion on all levels,” Mangold said. Indeed, “Logan,” with its high body count and post-apocalyptic vibe, stands in stark contrast with the cultural moment — as the film was playing to full houses, Trump was at his most rococo, tweeting allegations about wire-tapping and taking swipes at Arnold Schwarzenegger’s “Apprentice” run.

In the late 1960’s, studios turned away from splashy musicals and biblical epics to concentrate on more character-driven films. Movies like “Bonnie & Clyde” and “The Wild Bunch” spoke to younger audiences who felt politically disenchanted. These ballets of bullets updated the crime film and the western, while speaking to people turned off by the war in Vietnam.

Even with protests sweeping the country, it might be unrealistic to expect that there will be many more films that use populist genres to make larger artistic statements or score political points. “Logan” or “Get Out,” a thriller about race relations, are commercially successful while being creatively bold, but there are financial reasons why they will remain anomalies. Most comic book movies boast budgets that are north of $150 million. They inspire toylines, adorn happy meals, and launch theme park rides. That kind of merchandising is where the real money is made. “Logan’s” violence may delight audiences and may tap into the zeitgeist, but images of Wolverine vivisecting bad guys won’t be appearing on lunch boxes any time soon.

Still, at a time when nearly every major studio is in the superhero game, Fox has made a wise bet by crafting comic book movies for audiences that can legally drink. Box office analysts think that other studios such as Warner Bros. should take note. They believe that “Suicide Squad” or the upcoming Batman standalone film might benefit from more carnage. At the very least, Warner Bros. could try releasing both PG-13 and R-rated versions.

“It’s all about continuing to move the genre forward and be more malleable,” said Bock. “You can’t pitch the same PG-13 movies over and over or they will become stale.”

Ultimately, there’s no surefire formula. Directors can’t just ratchet up the violence and sprinkle in a few choice four-letter words and expect audiences to turn up for the latest comic book movie. Both “Deadpool” and “Logan” also benefited from strong reviews.

“An R-rating is a huge differentiator, but you still have to make a good movie,” said Paul Dergarabedian, senior media analyst with ComScore.

All too often, it’s that last ingredient that’s left out.

WATCH: The Evolution of Hugh Jackman’s Wolverine from X-Men to Logan