David Cameron has declared himself "delighted" to have kicked off the formal renegotiation process which will pave the way for an in/out referendum on Britain's membership of the European Union.
But the Prime Minister's demand for a rethink of the UK's relationship with Europe was completely overshadowed at the European Council summit in Brussels by a furious row over the fate of migrants crossing the Mediterranean by boat.
After a fiery meeting which stretched into the early hours, European Council President Donald Tusk announced that 40,000 migrants will be relocated from Italy and Greece over the next two years to other EU states and a further 20,000 resettled, though there was no agreement on mandatory quotas for individual countries.
Disputes over the migrants, along with the debt crisis in Greece, have dominated a summit which Mr Cameron had hoped to use as a springboard for his coveted renegotiation.
In the event, he addressed fellow EU leaders for only about 8-10 minutes in a brief break in discussions on migration which saw Italy's premier Matteo Renzi pitched against countries including Hungary, Poland and Lithuania.
Mr Renzi was reported to have accused other EU states of lacking "solidarity" because of their unwillingness to take in the thousands of largely Syrian and Eritrean refugees who have ended up in his country, telling them: "If you don't want to take the 40,000 you are not fit to be called Europe."
Britain has signalled it will not accept a mandatory quota of migrants, and its opt-out on EU home affairs matters means it is not obliged to do so.
Mr Cameron secured agreement for "technical" talks between UK and EU officials over the next six months on British concerns including restricting welfare for EU migrants, an opt-out from the goal of "ever-closer union" in Europe, greater powers for national parliaments and protections for countries - like the UK - which are not members of the single currency.
Mr Tusk confirmed that EU leaders will be presented with the results of the talks at a summit in December. But he warned: "One thing should be clear from the very beginning. The fundamental values of the EU are not for sale and so are non-negotiable. We should consider British concerns, but only in a way which will be safe for all Europe."
Earlier, the European Parliament's President Martin Schulz had warned there was "quite some resistance" among EU states to any changes to the treaties, which he said could anyway take as long as four years.
"Solutions in the EU usually are not brought about by one member state making demands and expecting the others to deliver," said the German Social Democrat.
European Commission President Jean Claude Juncker appeared unsure what reforms Mr Cameron was seeking, asking reporters: "What does he want?" And Belgium's finance minister Johan Van Overtveldt said a British opt-out from ever-closer union would be "not easy".
Mr Cameron has made clear the reforms he is seeking will require changes to the EU's treaties. But British officials acknowledged that any such changes are unlikely to be in place by the time Britain votes in the referendum, promised by the end of 2017.
Labour accused the Prime Minister of retreating in the face of opposition from other EU states.
Shadow foreign secretary Hilary Benn said: "All year the Prime Minister has been saying that change to the treaty was a definite requirement and yet now, faced with entirely predictable opposition from other member states, he is signalling retreat while pretending that all he ever wanted was a post-dated cheque."
But UK officials insisted Mr Cameron will secure "legally-binding and irreversible" assurances that EU law will be changed to incorporate the reforms, which will be "crystal clear" to voters.
They played down suggestions that any such agreement could be blocked by referendums in other member-states, such as Ireland, which observe the convention of putting treaty changes to a public vote.
They insisted that there was no change in Mr Cameron's position on the timing of treaty changes, insisting the UK had always assumed they would not be in place by the time of the referendum, because of the lengthy process of ratifying them in national parliaments across the EU.
Speaking as he left the talks at around 2.45am, Mr Cameron said: "I am delighted that the process of British reform and renegotiation and the referendum we are going to hold - that process is now properly under way.
"People always say to me these things aren't possible, we will never get them done. Once again, we have proved we will get them done.
"We have started that process and it's under way."
Meanwhile, Nigel Farage suggested that the Prime Minister had dragged the Queen into the EU row after she warned of the dangers of "division in Europe" in a speech during her state visit to Germany.
"She must not let the Government pressure her into saying things that appear to influence the referendum," said the Ukip leader.
"She is, after all, the head of the Commonwealth as well as head of the UK, and there is a potential conflict of interests there."