Hugh Jackman may be leaving, but “Logan” suggests a winning formula for Fox. (Twentieth Century Fox 2017)

TWENTIETH CENTURY FOX is being handsomely rewarded for carving out a different superhero path for the 21st century.

One year after the Fox underdog “Deadpool” struck box-office gold, “Logan” is repeating that feat — thanks to crucially similar elements in their approaches.

In Hugh Jackman’s ninth and final turn as his feral X-Men character, “Logan” grossed $85.3 million in its domestic debut to win the box-office weekend, according to studio estimates Sunday — roughly matching what the character’s first solo film, “X-Men Origins: Wolverine” ($85.1 million), opened to in 2009. Final numbers are due Monday.

Combined with an impressive $152.5 million overseas, “Logan” grossed a whopping $237.8 million worldwide. That total puts the film close to the neighborhood of “Deadpool,” which had a global opening of $264 million.

It’s apropos that a teaser scene for “Deadpool 2” plays ahead of “Logan,” and not only because the audiences for both Fox smashes seem to have a massive overlap. The comic-book hits, in tandem, are allowing Fox to distinguish some of its superhero cinema from Marvel Studios and Warner Bros./DC.

For Disney/Marvel and DC, this has largely been the decade of the PG-13 superhero team-up, as the Avengers, Suicide Squad, members of the Justice League and even the Guardians of the Galaxy take a gang-up approach to the box office.

Fox largely sparked this team-up wave with 2000’s “X-Men.” Yet that franchise is showing natural wear and tear, with last year’s “Apocalypse” receiving mixed reviews and doing relatively middling box office on a $178 million production budget.

What Fox should continue to learn from is the fortuitous twinning of Ryan Reynolds’s first solo Deadpool outing and Jackman’s Wolverine farewell.

Both films are R-rated, which involves a leap of faith that enough adults will embrace grown-up superhero fare to compensate for the loss of some adolescent moviegoers. So far, that strategy has paid off in spades.

While other studios try to push the PG-13 rating while staying within it, Fox is emboldening some of its superhero filmmakers to take off the shackles and amp up the violence (as well as, in Deadpool’s case, a bit of the sexual content). That creative freedom seems to permeate both films, which feel more like the work of auteurs than studio machinery.

Fox is also banking on the high appeal of these two characters, both sprung from the pages of Marvel comics. Because “Deadpool” and “Logan” are not particularly beholden to the extended X-Men film universe, these two movies can also feel like especially textured character studies.

And then there is this matter of those budgets. For most major-studio superhero releases, the production costs begin to approach $200 million — with “Captain America: Civil War” and “Batman v Superman: Dawn of Justice” each hitting a quarter-billion.

“Logan,” by contrast, cost $97 million to make, and “Deadpool” was made for a relatively paltry $58 million.

Fox might be losing Jackman’s Wolverine, but the studio has gained a uniquely strategic seat at the superhero table.

If Fox suits are smart, they will only build on that fresh perception and brand of comic-book standout.