Like elsewhere in Europe, France's far right has benefited from a cost-of-living crisis, untamed immigration and resentment towards a political class that Macron has failed to bring closer to common folk despite promising to shake up politics in 2017.

But Marine Le Pen also got a head start in the race by placing her own rising star, 28-year old Jordan Bardella, at the helm of her European campaign team, as her Rassemblement National (RN) is running up to 10 points ahead of Macron's centrist Renaissance in opinion polls.

Macron's strategists have become increasingly worried about Bardella's popularity in recent weeks.

A video of the young MEP receiving rock star treatment at a food market by a crowd of adoring fans requesting selfies at the end of November got alarm bells ringing in Macron's camp, a source with knowledge of the president's thinking told Reuters.

"The president said we urgently needed someone to take on Bardella," the source said.

Attal, 34, France's youngest-ever prime minister, is of the same calibre - he is a smooth communicator, a skilled debater in parliament and on radio shows, and has shown an ability to seize political opportunities and win over the conservatives voters Macron is after.

"It was the best card the president had up his sleeve," IFOP pollster Jerome Fourquet said on BFM TV. "He wants to counter Bardella's rise, especially in view of the major political event later this year, the European elections."

As education minister, his first move was to ban the Muslim abaya dress in schools, drawing rave reviews in the increasingly influent right-wing media empire built by Vincent Bollore, the French Rupert Murdoch.

FRENCH INFLUENCE IN EUROPE

Doing well in European elections is crucial if Macron wants to remain as influential in Brussels as he has been over the past six years.

In the last elections in 2019, his party came within a whisker of RN, giving the two camps the same number of seats and Macron's fledgling party enough troops to weigh on the choice of the EU's top jobs.

Should RN do massively better than Macron's party, it would not only be symbolically painful, it would also reduce Macron's influence on EU policies, since his Renew grouping is also bound to lose many Spanish and Dutch lawmakers.

France's influence in Europe has grown under Macron, with Britain's departure and former German Chancellor Angela Merkel's retirement leaving way for more statist French ideas to influence EU policymaking.

But this election comes against a backdrop of populist gains from Slovakia to the Netherlands, testing the ability of Macron's European family to maintain an influential role inside parliament.

Some think Macron should be more focused on problems at home.

"Emmanuel Macron is very busy on the international stage, but he must come back to the domestic arena and take care of people's problems like education and housing, which are real ticking bombs," Patrick Vignal, an MP in Macron's party, said.

RESTORING AUTHORITY

It remains to be seen whether Attal can do as well as prime minister as he did in previous roles.

Beyond his long-stated goal of bringing France back to full employment, Macron said in his New Year address he wanted a "Civic Re-Armament" - a restoration of authority to counter what he sees as a collapse in civility and a fragmentation of society.

"With his main reforms passed, Macron will push for policies that will be more societal and atmospheric and probably less divisive," Mujtaba Rahman, an analyst at Eurasia, said in a note. "They will try to respond to popular anxieties about French democracy, crime and anti-social behaviour."

The anxieties follow riots in city suburbs which shocked France last summer and a series of grim murders and Islamist attacks. It is not clear what Attal could do to start reversing what is a long-term development with complex causes.

Managing ministers years his senior will also require authority and strong will. The role of prime minister also has the reputation of a poisoned chalice - usually the fall guy whenever the president is getting unpopular.

That was Bardella's ominous message to Attal on Tuesday.

"By naming Gabriel Attal, Emmanuel Macron wants to get on his popularity bandwagon and soften the pain of this never-ending fin de regne," he said on the social media messaging platform X.

"He rather risks dragging the short-lived education minister down in his fall."

(Writing by Michel Rose; additional reporting by Elizabeth Pineau; editing by Nick Macfie)

By Michel Rose