BRUSSELS (Reuters) - Prime Minister David Cameron urged European Union leaders on Thursday to agree to "substantial reforms" and demonstrate the kind of flexibility on migration that Britain needed for him to persuade voters to stay in the bloc.
In his longest address in more than five years attending European Councils, Cameron told the 27 other national leaders over dinner that if they wanted to keep Britain in the EU at a referendum he has promised to hold within two years, they must address British voters' concerns about immigration.
But despite some warm words of encouragement from European leaders, his push to curb welfare payments to migrants from the bloc was challenged by some for potentially breaking EU principles of non-discrimination and free movement of people.
"The levels of migration we have seen in a relatively short period of time are unprecedented, including the pressures this places on communities and public services. This is a major concern of the British people that is undermining support for the European Union," Cameron said in remarks relayed by British officials.
"We need to find an effective answer to this problem."
Cameron began his pitch after European Council President Donald Tusk told the summit there was good progress on three of London's four key demands, but the fourth - to deny EU migrants in-work benefits for four years - was "very difficult".
Other leaders around the dinner table want to help Cameron ensure that Europe's second biggest economy and one of its two top military powers chooses to stay in the EU. Opinion polls show the number of Britons wishing to leave is growing.
But the Conservative leader faced an uphill struggle to win agreement on curbing welfare payments to EU migrants to try to reduce immigration, a proposal several leaders, especially from eastern Europe, say breaks the fundamental EU principles.
"I want to see real progress in all of the four areas that I have mentioned," he said on arrival. "We're not pushing for a deal tonight but we're pushing for real momentum so that we can get this deal done. So I will be battling for Britain right through the night and I think we'll be getting a good deal."
Over filet of venison with parsnip mousse and Szechuan pepper jus, the British prime minister sought to convince fellow leaders that the UK's continued membership hinges on finding a convincing solution to the sensitive immigration question.
Cameron says he wants Britain to stay in the EU, but has hinted he could campaign for an exit if he fails to win an agreement that can reduce the influx of EU migrants, improve business competitiveness, give more sovereignty back to Britain and protect London's banks from discrimination by the euro zone.
His proposal to make European immigrants to Britain wait four years before claiming "in-work" benefits - income supplements to people in lower paid jobs - has been roundly criticized for breaking EU law banning discrimination.
An EU aide said Tusk wanted to give everyone a chance to speak their mind on Thursday night with a view to seeking a deal at the next summit in mid-February.
Poland, Hungary, Slovakia and the Czech Republic, known as the Visegrad Group, said in a statement they would reject any British demand to change EU laws that would mean discrimination against their citizens or limit their freedom of movement.
For many Europeans born east of the Iron Curtain, that freedom is a touchstone of their post-Cold War liberation.
Cameron presented his four-year proposal, but made clear that he was open to other ways to better control immigration to Britain. "Are we going to find the flexibility to address the concerns of the UK and work together to fix this?" he asked.
An EU diplomat said Cameron had earlier sat in silence for more than three hours while other EU leaders debated how to deal with a wave of migrants that has divided European governments. Britain has refused to take in any from Europe.
Drawing the European Union's focus to a small part of Britain's welfare system has raised eyebrows among some leaders who are trying to hammer out a deal to house hundreds of thousands of refugees and respond to a war in Syria.
But EU officials said most were keen to help Cameron return to Britain with a message that he is succeeding in the talks.
"There's a certain orchestration to make sure that tonight things work out well for David Cameron, to make it look as that he is winning, because no one wants a Brexit," a senior official close to the talks said.
Despite the goodwill, the difficulties of securing any agreement on welfare looked a way off.
German Chancellor Angela Merkel said on arrival that she wanted an open discussion, but "at the same time do not want to limit the basic liberties, non-discrimination, free movement, of the European Union".
French President Francois Hollande agreed, saying it would "not be acceptable to revise the very foundations of European commitments", while a source close to the talks put it bluntly: "There's going to have to be a lot of creative thinking."
Some governments, notably euro zone powerhouse Germany, are also wary of Cameron's demand for Britain to have safeguards from any move by the 19 countries that share the euro currency to impose rules by majority vote on London's financial center.
They are also reluctant to formally acknowledge that the EU is a multi-currency union, even though Britain and Denmark opted out of the euro and seven other countries have yet to adopt it.
Cameron has been touring capitals to drum up support for demands that he says will help convince people to stay in the bloc. The senior government source said he had held several bilateral talks before the dinner.
The British government hoped the dinner would signal a political will to accelerate technical talks on how London's demands can be made watertight in EU law. An agreement early next year could give Cameron time to stage the referendum in June, seen by some analysts as a good time before summer.
That is when migrants fleeing conflict and poverty in Africa and the Middle East may start making the treacherous journey to Europe, images that have fueled fears about rising immigration in Britain -- even though Britain is not part of Europe's open-border Schengen zone, through which migrants have been moving.
Additional reporting by Gabriela Baczynska, Alastair Macdonald, Robert-Jan Bartunek, Philip Blenkinsop, Elizabeth Pineau and Andreas Rinke in Brussels; Editing by Alastair Macdonald and Paul Taylor