France’s President Emmanuel Macron named Education Minister Gabriel Attal as prime minister on Tuesday in a bid to breathe new life into his presidency, with the 34-year-old becoming the country’s youngest head of government.

Macron late on Monday accepted the resignation of Elisabeth Borne, 62, ahead of a widely expected government reshuffle in a bid to regain momentum ahead of the tough European elections in June.

The shake-up was widely seen as an attempt by the 46-year-old centrist Macron to head off a looming lame-duck status. Macron’s term is to end in 2027, and he will not be able to run for president for a third consecutive term in line with the French Constitution, The Associated Press commented.

The resignation of Borne also came following the recent controversial immigration legislation passed by Macron, a bill that has made it easier to deport some foreigners and one that has been widely viewed as a win for the far-right National Rally party.

In her resignation letter, Borne suggested she resigned at Macron’s request, citing the president’s “will” to “appoint a new prime minister”.

Tensions over the immigration legislation resulted in December’s departure of health minister Aurelien Rousseau in protest as well as anger expressed by some other senior cabinet members.

Macron’s centrist alliance was able to pass the measure only after making a deal with the conservative Republicans party, which many observers saw as the government’s shift to the right. The tough negotiations and heated parliament debate raised questions over the ability of Borne’s government to pass future major bills.

‘Exemplary’ leader

In a message posted on X on Monday, Macron praised Borne for being “exemplary every day”.

“You have implemented our project with stateswomen’s courage, commitment and determination. Thank you from the bottom of my heart,” Macron said.

Borne took office in May 2022 after Macron was elected for the second five-year term. She governed without an absolute majority in the French lower house, something rare in France’s political history. Borne was the country’s second female prime minister after Edith Cresson under president Francois Mitterrand 30 years ago.

The upcoming government reshuffle is also seen as Macron’s preparation for his party’s next presidential election in 2027. Former prime minister Edouard Philippe and National Rally’s Marine Le Pen are expected to be among people in the race.

National Rally Vice-President Sebastien Chenu applauded Borne’s resignation on Monday, saying in a message on X, “Finally!”

The National Rally, now led by Jordan Bardella, is leading Macron’s coalition by 10 percent in the latest poll, a sign that many interpreted as a potential win for the far-right party in June’s European elections.