Brussels - British Prime Minister David Cameron closed in on a difficult reform deal with European Union leaders at a summit on Thursday but warned there would be hard work to seal an accord by February as hoped.
After appealing to sceptical EU counterparts for help at a dinner in Brussels, Cameron said afterwards there was a "pathway" to an agreement but that it would be "tough" to hammer out differences over his demand for a freeze on benefits for EU migrants.
The other 27 leaders agreed to work for a compromise despite reservations over Cameron's reforms, which he says he wants to secure before holding a referendum by the end of 2017 on a possible "Brexit" from the EU.
"Really good progress has been made but it is going to be tough," Cameron told a news conference, adding that there was a "pathway to a deal in February but the truth is it will be very hard work".
Donald Tusk, the Polish EU president, said he was "much more optimistic" after what he described as a "make or break" summit on Cameron's demands, especially on the four-year limit before EU migrants working in Britain can claim benefits.
"Leaders voiced their concerns but also demonstrated willingness to look for compromise," Tusk told a news conference after the summit.
In their conclusions the leaders "agreed to look to find solutions" on all four of the areas that Cameron wants reforms which include protections for countries that are not in the eurozone, an exemption from more EU integration and greater economic competitiveness.
The turnaround came just hours after both Tusk and French President Francois Hollande warned Cameron that his demands were "unacceptable".
"If it is legitimate to listen to the British prime minister, it is unacceptable to revise founding European commitments," Hollande said.
Germany's powerful Chancellor Angela Merkel said she wanted to keep Britain in Europe but would "not limit the fundamental principles of the EU".
In his speech to his peers, Cameron said Britain had faced "unprecedented" migration in recent years and warned that it could spur Britons to vote to make United Kingdom the first country to leave the union.
"Are we going to find the flexibility to address the concerns of the UK and work together to fix this?" he said.
The British dilemma stole the limelight from fresh efforts to tackle the migration crisis that has made this year one of the toughest in the bloc's history and triggered many of the record 12 summits the leaders have held since January.
With Europe already deeply split by a year that has seen a record inflow of nearly one million mainly Syrian refugees, crises in Greece and Ukraine as well as terror attacks in Paris, Cameron's demands have largely been seen as a distraction.
New border force
Tusk said leaders agreed to push through by June 2016 a plan for a new border and coastguard force that could intervene in member countries - even without their consent - in order to shore up the EU external frontier.
He said they also agreed to protect the Schengen area, the cherished European passport-free zone that symbolises that ideal of free movement but has been threatened by the huge movements of people across the continent.
But officials said some had voiced concerns at the national sovereignty issues raised by the new border force, such as Poland and Greece, the country that has seen by far the biggest number of migrant arrivals.
Wide rifts have emerged over the migrant crisis after Merkel opened Germany's doors to Syrian refugees, causing huge strains on transit countries and prompting several to suspend the Schengen rules and reintroduce border checks.
Playing down divisions, Merkel hailed a "very good" meeting between 11 EU states and the Turkish prime minister on the sidelines of the main summit to discuss a plan to resettle thousands of Syrian war refugees directly from camps in Turkey.
But an EU report on Thursday said that a €3bn deal with Ankara in November to keep more refugees on Turkish soil had so far had little effect on the number of people crossing to Greece.
Other plans have been bogged down, with a deal for member states to take in 160,000 refugees from overburdened Greece and Italy resulting in just 208 people being relocated so far.