Brussels - As the dust settles from EU elections, European Commission chief Ursula von der Leyen appears in prime position to secure a new term -- but she'll need to wheel and deal to lock it in.

While the headline from the night was gains for the far right that unleashed a political earthquake in France, German conservative von der Leyen, 65, appeared among the other main winners.

She saw her centre-right European People's Party (EPP) strengthen its grip on first place in the European Parliament -- as centrist forces maintained an overall majority.

"We won the European elections," a smiling von der Leyen told her grouping as the results were announced.

In theory that looks like opening up the road for the former defence minister to win another five years at the helm of the EU's powerful executive. 

But she still faces a nail-biting push to win over EU leaders and shore up enough support in the new parliament. 

'We have won the European elections', says von der Leyen

"The outcome puts European Commission President Ursula von der Leyen in pole position to secure a second term," wrote Mujtaba Rahman, analyst at Eurasia Group.

But he added: "There is still a real risk of her not being confirmed by EU lawmakers, given possible defections from the centre right, centre left, and liberals."

The first step for von der Leyen will be getting the backing of a weighted majority of EU leaders -- 15 out of 27, representing 65 percent of the bloc's population.

Informal discussions should start with a powerful trio -- German Chancellor Olaf Scholz, French President Emmanuel Macron and Italian Prime Minister Giorgia Meloni -- on the sidelines of a G7 summit from Thursday.

That will be followed up next week when all EU leaders meet for dinner in Brussels -- and then decision time should come at a crunch summit at the end of June.

"The EPP's lead candidate, von der Leyen, has a good chance of securing the nomination," said Deutsche Bank analyst Marion Muehlberger, pointing out that a dozen of the bloc's leaders come from the same group as her.

001_34U42AA_JPEG.jpg

Composition of seats by political group in the incoming European Parliament 

"However, the Council's negotiations on EU top jobs are not entirely predictable and a surprise candidate -- although it seems unlikely -- cannot be entirely ruled out."

Von der Leyen herself was a surprise pick last time around in 2019 -- chosen in a backroom deal after leaders swatted away several frontrunners.

Scholz and Macron have both emerged weakened from the EU vote after stinging losses to the far right -- with the French leader gambling on snap national elections in response.

Before the elections, von der Leyen had already begun courting hard-right leader Meloni, who emerged stronger after a decisive victory for her party.

This time, as ever, it will take arm-twisting and offers of influential jobs in Brussels to the key countries to guarantee support.

But analysts broadly agree von der Leyen should end up with enough leaders on board. 

000_34W447M.jpg

Ursula von der Leyen is the lead candidate for the European People's Party. Photo: Kenzo Tribouillard / AFP

- Doing the sums -

The quest for a simple majority in parliament on the other hand could prove tougher -- ahead of a secret ballot pencilled in for mid-July.

The sums should be comforting for von der Leyen.

Adding the EPP's 185 seats, to those of the centre-left Socialists and Democrats (S&D) and liberal Renew who backed her last time gives a comfortable majority of 401 in the 720-seat legislature, according to provisional results.

But it's not quite so simple.

Allegiances in the European Parliament can be notoriously fluid, and political families often don't vote as cohesive blocs.

"Simple mathematics gives her a majority, but there isn't even unanimity on her within the EPP," said Pascale Joannin from the Schuman Foundation think tank.

000_34W93YP.jpg

Ursula von der Leyen says she will seek the support of the S&D and Renew blocs. Photo: Kenzo Tribouillard / AFP

"Her election will depend on the programme she sets out and she needs to keep on campaigning to make sure she convinces."

Last time von der Leyen scraped through by nine votes. 

Talking Monday to her German party members, von der Leyen said she would focus first on securing support from S&D and Renew. 

"But that leaves other doors open," she said.

The Greens -- who saw their vote drop across Europe -- have already signalled they could give their backing. 

In return, she'd likely have to give assurances she won't backtrack on the EU's environmental ambitions. 

Otherwise, she could seek a deal with Meloni and her post-fascist Brothers of Italy grouping -- potentially skewing the EU further to the right. 

"My expectation remains that von der Leyen will want to get elected by a centre-majority with EPP, S&D and Renew, plus cooperation with Meloni in the European Council," wrote Nicolai von Ondarza, analyst at the German Institute for International and Security Affairs.

"But this potential liberal/centre-right/national conservative coalition will really change the dynamics in EU policy-making."

By Max Delany

Infographic by Valentina Breschi & Guillermo Rivas Pacheco