David Cameron has conceded that he faces a tougher fight to persuade Britons to vote to remain in the EU, after he was overwhelmingly defeated in his bid to block an arch-federalist and long-time Brussels insider from becoming the next president of the European Commission.
The Prime Minister was left isolated in Europe as his fellow-leaders rejected his pleas and voted 26-2 to nominate former Luxembourg PM Jean-Claude Juncker for the EU's top job, in a departure from the decades-old tradition that Commission chiefs are chosen by consensus among all member states. Only Hungarian PM Viktor Orban joined Mr Cameron in voting against Juncker.
Mr Cameron said his fellow leaders had made "a serious mistake", but insisted that he did "the right thing" in taking an outspoken stand against the appointment - which must now be confirmed by the European Parliament in a vote on July 16.
"This is a bad day for Europe. It risks undermining the position of national governments, it risks undermining the power of national parliaments and it hands new power to the European Parliament," he said.
"In a Europe crying out for reform, we have gone for the career insider."
Challenged over whether the outcome would harm his chances of securing the renegotiation of the UK's EU membership he has promised before an in/out referendum in 2017, Mr Cameron said: "The job has got harder. It makes it harder and it makes the stakes higher.
"This is going to be a long, tough fight and frankly sometimes you have to be prepared to lose a battle in order to win a war. It has only stiffened my resolve to fight for reform in the EU, because it is crying out for it."
And asked directly if he might end up recommending a British exit in the referendum, he said: "I believe Britain's national interest lies in reforming the EU, holding a referendum about that reform in the EU and recommending that we stay in a reformed European Union.
"Has that got harder to achieve? Yes. Is it still the right thing to do? Yes. Will I give it absolutely everything I have got to achieve it? Yes, I will."
Mr Cameron insisted he had taken "some small steps forward" by securing changes to the text of a document setting out the EU's strategic agenda for the next five years to make clear that the 28-nation bloc is ready to address British concerns about its direction of travel and accepts that its commitment to "ever-closer union" does not preclude individual members taking their own decisions on the pace of integration.
He also secured agreement on a review of the process of selecting future Commission presidents, arguing that giving the job to the candidate of the largest political grouping in the European Parliament risked handing the power of appointment over to MEPs making backroom deals.
Labour leader Ed Miliband said: "On Europe, David Cameron has now become a toxic Prime Minister. He cannot stand up for Britain's national interest because when he supports something, he drives our allies away."
But Mr Cameron said: "I feel totally comfortable with the decision I took, the stance I took, the arguments I made and the way I conducted this.
"Was it the right thing to do to make this stand? I absolutely think it was and I would do it all over again in pretty much the same way."
He took a swipe at EU leaders who backed Mr Juncker in the vote despite privately expressing reservations about his candidacy, and said that it was "a matter of regret" that he had ended up on the opposite side from German chancellor Angela Merkel.
Mrs Merkel - whose intervention was decisive in persuading other waverers to fall in behind the Juncker candidacy - denied other countries had been offered top Commission posts in return for backing the nomination and said the leaders agreed to address UK concerns.
"There is no kind of backroom agreement," she said. "It is up to those countries to decide whether they support or not support this person that was suggested."
She added: "It was made clear yet again that the idea of an ever-closer union, as it is stated in the treaties, does not mean that there is equal speed among the member countries but there can be different speeds that member countries adopt to come to ever-closer union.
"We also stated that the concerns the UK has will be addressed also as regards the European developments."
In a message issued in English, French and German on Twitter, Mr Juncker - who was pictured relaxed and smiling in a Brussels bar as he awaited the outcome of the vote - said: "I am proud and honoured to have today received the backing of the European Council. I am now looking forward to working with MEPs to secure a majority in the European Parliament ahead of the vote on 16 July."
Mr Cameron said he would work with the new president-designate, despite his harsh words during the battle to block his candidacy.
"We have got a result, we have to to accept the result and we have to work with the incumbent," said Mr Cameron. "I am sure we will manage to put together a working relationship."
Simon Walker, director general of the Institute of Directors, said: "Now that the Council has nominated Jean-Claude Juncker as Commission president, British eyes should fix their attention on shaping his policy priorities and building bridges to ensure a key economic portfolio is secured.
"While it is admirable - and refreshing - that a British Prime Minister should stand up for principle and the UK's interests in Europe, reality and pragmatism must now dictate the Government's approach to reform.
"Britain is nowhere near as isolated as many commentators would have us believe. A number of leaders agree with the UK's economic reform agenda, and Mr Cameron must draw on this support to push the new Commission to focus on boosting competitiveness for the EU as a whole."
John Longworth, director general of the British Chambers of Commerce, said: "The Prime Minister fought to secure the best possible outcome for Britain, and he was right to do so, but being right doesn't always mean you win. The campaign for fundamental reform of the European Union is backed by British business, and it must not end here.
"The Prime Minister's top priority must now be to secure safeguards for Britain in the face of renewed Eurozone integration. Safeguards against decisions the EU is yet to take are even more important to the future of British business than reforming the EU's existing rules.
"He must also ensure that the UK has a top economic portfolio in the new Commission."
Mats Persson, director of pro-reform think-tank Open Europe, said: "The Juncker episode is clearly a substantial defeat for David Cameron and, without remedy, increases the risk of Brexit. However, it is far from the end of the story for sweeping European reform.
"Though certainly not by design, Cameron's hand might even be strengthened after this episode, given the heightened risk of the UK leaving the EU and the realisation in Berlin that it might be left alone with a sluggish Med block caucusing against Germany.
"Cameron must respond by getting straight back into the ring. He needs to set out a much clearer vision for what he wants Europe to be all about, send a heavy-hitter to Brussels capable of getting an EU top job and appoint an EU reform taskforce, charged with road-testing ideas that would genuinely de-centralise decision making."