The horse trading before the selection of the new head of the Eurogroup is getting nasty.

A day after four countries submitted their official nominations, charges of political manipulation upended the already-tense contest for Eurogroup president. On Friday, Luxembourg reacted with dismay to a potential backroom deal in which Germany’s conservative government would back Portugal’s socialist candidate to lead the powerful forum of eurozone finance ministers. Officials in Luxembourg, which is fielding its liberal Finance Minister Pierre Gramegna for the job, said they believed Germany had cut a deal with Mediterranean countries that would install Portugal’s Mário Centeno.

Berlin denied any such deal and insisted that the government has yet to settle on a preferred candidate in the race. But in a convoluted give-and-take process, an agreement between Germany and Portugal could potentially ease Chancellor Angela Merkel’s efforts to form a new coalition government with the German social democrats of the SPD.

SPD leader Martin Schulz has so far been non-committal toward Merkel’s advances. But Schulz, a former European Parliament president, shares French President Emmanuel Macron's appetite for eurozone reform. A key quality Germans are said to be looking for in the next Eurogroup leader is someone who won't make financial markets jittery. Schulz is also said to like Centeno, and Portugal is an example of something that has recently become a rarity in Europe — a successful socialist government.

The winner will be decided Monday afternoon by the 19 eurozone finance ministers in a secret ballot. Each country gets one vote, and whoever gets 10 votes first wins. Luxembourg officials insisted they still have the weekend to straighten out the situation and line up the needed votes but were concerned that Germany’s struggles to secure a coalition at home could trump their bid.

All of the EU's five top posts except the Eurogroup are now led by conservatives from the European People’s Party.

“The Germans are in very difficult situation because they don’t have a coalition,” a government official in Luxembourg said. “Now, they might have to settle for something with the German social democrats, and this is one of the reasons why they could consider supporting a socialist" for the Eurogroup.

Eurozone diplomats in Brussels said they were hardly surprised by Germany’s decision to flirt with Portugal’s candidate after the liberal Free Democrats abruptly abandoned coalition talks in Berlin — leaving Merkel's efforts to form a new government in disarray.

Meanwhile, people in Portuguese circles also told POLITICO that they’re counting on the support of Germany and France, following private talks among leaders on the margins of the EU-Africa summit this week in Abidjan.

The EU's latest leadership pageant illustrates the high stakes and sensitive balancing act among the EU’s political groups when it comes to dividing up the bloc's five top posts: the presidencies of the European Commission, Council, Parliament, Central Bank and Eurogroup.

All except the Eurogroup are now led by conservatives from the European People’s Party (EPP), which this week decided not to field its own candidate to lead eurozone finance ministers. Dutch socialist Jeroen Dijsselbloem has the job until January.

In Brussels, liberal politicians have joined their colleagues in Luxembourg in indignation, arguing that a conservative-socialist stitch-up for the Eurogroup presidency would betray the spirit of an agreement that secured a conservative — Italy's Antonio Tajani — for the post of Parliament president in January.

In a clear hint that political bargaining was underway, Spain’s Finance Minister Luis de Guindos orchestrated the EPP strategy of bowing out Wednesday in an apparent bid to keep the political peace with socialists.

But the situation was quickly complicated by Slovakia’s socialist Finance Minister Peter Kažimír, who also made an unexpected bid for the Eurogroup presidency, threatening to pull support away from Centeno — and handing the prize to a non-socialist. Latvia’s Dana Reizniece-Ozola of the country’s Greens and Farmers party is the fourth candidate.

As the only liberal candidate, Luxembourg's Gramegna could be best positioned to snatch a win. He clearly feels it's the liberals' — and therefore his — turn to wield power at the pinnacle of the EU.

"Liberals are the third-largest group in the European Parliament and are the head of eight countries in the European area," Gramegna told POLITICO. "We think that this is something that must be taken into consideration."