After weeks of discussion and a bruising confrontation with Britain, EU leaders finally gave the thumbs up to Jean-Claude Juncker to lead the European Commission for the next five years.

The decision, which now has to be approved by the European Parliament at its mid-July plenary session, took centre stage on the EU’s political scene since the European elections took place on 25 May, amid fierce resistance by UK Prime Minister David Cameron.

Italy’s centre-left prime minister, Matteo Renzi, who was initially lukewarm, finally backed Juncker in exchange for greater flexibility in the interpretation of EU budget rules and a shift in focus from austerity to pro-growth economic policies.

>> Read: EU leaders tie slower deficit reduction to reforms

The real winner, sources concur, is the European Parliament which, with a creative reading of the Lisbon Treaty, has initiated a procedure of nominating lead candidates for European Commission presidency, giving a face of the EU election campaign.

In the end, EU leaders approved a candidate that centre-right leaders had elected three month ago to lead the EU election campaign of the European People’s Party’s (EPP) at a congress in Dublin.

>> Read: Juncker beats rival in centre-right race for EU presidency

Speaking as acting president of the European Parliament, Italian centre-left MEP Gianni Pittella told EU leaders that the May elections have been a turning point for the EU as for the first time all major European parties presented lead candidates – or Spitzencandidaten – for the post of Commission president.

“The process of lead candidates has deepened a European-wide debate about European issues,” he said. “And without doubt, via this process the EU has become closer to its citizens, more transparent and more democratic.”

Cameron, the EU’s isolated ‘enfant terrible’

Juncker’s appointment comes as a blow for David Cameron, who led a campaign to block Juncker, but found himself increasingly isolated, as more countries rallied behind Juncker, except for Hungary.

Despite his defeat, the British Prime Minister said he ‘lost one battle but not the war’. He called the nomination of Juncker “a serious mistake”. “This is going to be a long, tough fight,” he said, adding that the ‘Spitzenkandidaten’ process was unacceptable, as it did not allow any serving prime minister to stand in the race. “This process developed a momentum of its own,” he insisted, saying that it sidelined smart and capable leaders.

“This is a bad day for Europe. It hands new power to the European Parliament,”Cameron said. “This whole process has simply reinforced my conviction that the EU has to change.”

David Lidington, Britain’s Europe minister, had warned earlier this week that choosing Juncker for the Commission job risked turning the EU executive into “a creature” of the European Parliament, a view that was apparently not shared by a majority of EU member countries.

EU leaders have nonetheless offered political concessions to Britian. They added in their final statement that London’s concerns about the future direction of the EU ‘will need to be addressed’ and that the principle of an ‘ever closer union’ in the treaties allowed for different paths of integration for different countries.

They also agreed to review the process for appointing the president of the European Commission once the new executive was in place.

>> Read: Opposition to Juncker wanes, Cameron isolated

The campaign turned ugly and personal in the run-up to the EU summit.

Juncker, the former long-serving prime minister of Luxembourg and son of a steelworker, was caricatured in the British press as a dangerous European arch-federalist, bent on alcohol and chain-smoking. British tabloid papers threw dirt on his father, saying he served in the Wehrmacht.

As the summit meeting resumed this morning in Brussels, Cameron told reporters: “There are times when it is important that you stick to your principles and you stick to your convictions. It is not right for the elected heads of government of the European countries to give up their right to nominate the head of the European Commission. And it is the wrong person,” he said, underlining his objections.

>> Read: Cameron vows to fight Juncker ‘to the end’

David Cameron has promised Britons an in/out referendum on the UK’s EU membership if he is re-elected next year, and said he would push the vote forward if Juncker was appointed.

Finland’s new prime minister, Alexander Stubb, said “we need to build some bridges” between the programme the UK puts forward, and the position of other member states on Juncker at the top of the executive. “But in the UK, I think people should really wake up and smell the coffee.”

Leaders will meet on 16 July, after the Parliament vote on Juncker, to discuss the appointments for the other top jobs, including the High Representative for Foreign affairs and security policy and the European Council president, as well as the composition of the next Commission.