With despondency and division deepening in France amid protests against President Macron’s pension reform, the country needed a savior to lift the mood. Step forward D’Artagnan.

The swashbuckling swordsman was recently called into action in a blockbuster adaptation of The Three Musketeers, released in cinemas on the back of hopes that it would see off Hollywood.

With a plot based on the first half of the 19th-century novel by Alexandre Dumas, and a sequel covering the second half due out in December, the movie was described by Dimitri Rassam, the producer, as a chance to “celebrate French panache”.

He threw down the gauntlet to his US rivals, whose films have been doing rather too well for the nation’s liking in recent months.

A “mixture of Indiana Jones, a western and the Tour de France”: Vincent Cassel, Romain Duris, and Pio Marmaï.

The Three Musketeers is the response of our French mythology to the American mythology of superheroes,” said Rassam, 41, the scion of a filmmaking dynasty and the son of Carole Bouquet, the actress who played Melina Havelock, the Bond girl alongside Roger Moore in For Your Eyes Only. Les Echos, the financial newspaper, said the aim was to “rival Marvel”.

In a country that views cinema as a core part of its cultural identity — and gives the sector more than $1 billion a year in subsidies — the stakes are high. Last year no French film got into the top ten in terms of box office takings in France for the first time in 33 years as American movies dominated.

The release in January of Asterix & Obelix: The Middle Kingdom, a $70 million movie featuring the comic-strip Gallic warrior, was widely viewed as the start of a fightback against US “cultural imperialism”.

Yet although it is the most popular film this year in France, it was panned by critics and has not done as well as expected, attracting 4.5 million cinemagoers to date.

With Asterix proving a “damp squib”, according to Libération, D’Artagnan has been left to carry the nation’s hopes.

The Three Musketeers is the response of our French mythology to the American mythology of superheroes,” says Dimitri Rassam.

The Three Musketeers: D’Artagnan and its planned sequel, The Three Musketeers: Milady, cost a total of $78 million, which is moderate by American standards but a lot for Europe.

Last year no French film got into the top ten in terms of box office takings in France for the first time in 33 years.

It features some of the country’s most celebrated actors, with François Civil, 33, as a brave and somewhat naive D’Artagnan; Vincent Cassel, 56, as Athos; Romain Duris, 48, as Aramis; and Pio Marmaï, 38, as Porthos. Eva Green, 42, the actress who starred alongside Daniel Craig in the James Bond film Casino Royale, is cast as the scheming Milady. Jacob Fortune-Lloyd, 35, a British actor, plays the Duke of Buckingham.

The movie is a long way from France’s intellectual art-house traditions. Instead, it offers intrigue, duels, death and love in the 17th century, when the country was divided between Protestants and Catholics, facing an English invasion and led by the weak Louis XIII — a timely reminder, perhaps, that Macron is not the first head of state to find his back against the wall.

The reviews have mostly been positive, with Le Monde describing it as a “mixture of Indiana Jones, a western and the Tour de France”.

However, some reviewers have complained that Martin Bourboulon, the director, has not been entirely faithful to the novel, and Le Figaro was snotty about his decision to make Porthos bisexual, for example.

Gene Kelly in 1948’s The Three Musketeers, also starring Lana Turner.

Bourboulon’s challenge was to put his own stamp on Dumas, whose works have been adapted for film and television at least 646 times — making them among the most widely screened of any author. The adaptations of The Three Musketeers include a 1970s’ Italian spaghetti Western and a 1950s’ German porn movie. D’Artagnan has been played by such actors as Gene Kelly, John Wayne and Volodymyr Zelensky, who starred in a Ukrainian musical version in 2005 before entering politics. As recently as last month, a low budget British adaptation was released with Malachi Pullar-Latchman as the Dumas hero.

The French blockbuster got off to an encouraging start, and was seen by 197,224 people on the day of its release. But that might not suffice to see off American invaders. The Super Mario Bros. Movie was seen by 281,442 people that day in France.

The Three Musketeers: D’Artagnan is in cinemas now

Adam Sage is the Paris correspondent for The Times of London. He has covered five presidential elections and countless scandals