* Voting ends in landmark EU referendum
* YouGov puts Remain ahead 52/48, Ipsos 54/46
* Political fallout to reach beyond Britain
* Sterling up on Farage comment, surveys
* For full coverage click on cpurl://apps.cp./cms/?pageId=brexit (Adds Cameron on Facebook; cabinet minister Villiers; signatories of letter backing Cameron)
By Kate Holton and David Milliken
LONDON, June 23 (Reuters) - Britons appear to have voted in a referendum to stay in the European Union, opinion polls showed on Thursday, and prominent 'Brexit' campaigners acknowledged they looked likely to lose.
Nigel Farage, head of the UK Independence Party and a leading voice in favour of leaving the EU, told Sky News: "It's been an extraordinary referendum campaign, turnout looks to be exceptionally high and looks like Remain will edge it."
Farage said his prediction was based on "what I know from some of my friends in the financial markets who have done some big polling". Government minister Theresa Villiers, who also campaigned for Britain to leave, told Sky News her instinct was that the Remain side had won.
A vote to stay would come as a massive relief to Britain's 27 EU partners, who had feared the departure of the bloc's second biggest economy would weaken Europe's global clout and fuel the rise of eurosceptic movements in other countries.
Before a single result had emerged from the 382 local counting areas, a survey by pollster YouGov showed Remain ahead by a margin of 52 to 48 percent. Unlike a classic exit poll, it was based on online responses by a pre-selected sample of people rather than a survey of voters as they left polling stations.
Pollster Ipsos-MORI also put Remain in the lead, saying that surveys it had carried out on Wednesday and Thursday gave it a 54-46 margin of victory. An Ipsos-MORI poll published earlier had just a 52-48 split for Remain.
The pound climbed to its highest for this year, rising above $1.50, up almost 1 percent on the day, though it later eased back to around 1.4950.
"It's early days and there will be twists and turns through the early hours of this morning but, for now, the markets have taken that YouGov poll as a strong indication that the Remain camp has won," said Jeremy Cook, chief economist at international payments company World First in London.
In the first result officially declared, the British overseas territory of Gibraltar bordering Spain voted overwhelmingly in favour of Remain, as widely expected.
The four-month campaign has sharply polarised the nation and the final outcome of the vote could change the face of Europe.
If Britain becomes the first state to leave the EU, the so-called Brexit would be the biggest blow to the 28-nation bloc since its foundation.
The EU would be stripped of its leading free-market advocate and one of its two main military powers, and could face calls for similar votes by anti-EU politicians in other countries.
Ralph Brinkhaus, a senior ally of German Chancellor Angela Merkel and deputy parliamentary floor leader for her conservatives in the Bundestag, told Reuters: "The released polls show the expected neck-and-neck race. It will remain exciting until the early morning hours. I hope that the British have decided against a Brexit."
If it votes to stay, Britain has been promised a special status exempting it from any further political integration, but European leaders will still have to address a sharp rise in euroscepticism across the continent.
A Brexit vote would also deal a potentially fatal blow to the career of Prime Minister David Cameron, who called the referendum and campaigned for the country to stay in, against a Leave camp led by rivals from within his own Conservative Party.
"Thank you everyone who voted to keep Britain stronger, safer and better off in Europe - and to the thousands of Remain campaigners around the UK," Cameron said on Facebook.
In a letter, 84 eurosceptic Conservative lawmakers called on Cameron to remain prime minister regardless of the result. It marked the first attempt to heal the deep rifts that have opened up in the ruling party since the start of the campaign.
The signatories included prominent Leave campaigners Boris Johnson, the former mayor of London, and Michael Gove, a cabinet minister and personal friend of Cameron.
But despite the statement of loyalty, Cameron would face huge pressure from the country at large to step down as prime minister if Britons have defied him and voted to leave.
Results are due to be announced between around 0000 GMT and 0300 on Friday.
There is no exit poll because the margin of error for an event which has no precedent is too large. Turnout in each counting area will be announced, beginning at around 2230 GMT.
The vote came on a day when London and parts of southeast England were hit by torrential rain, causing floods and widespread transport chaos.
Five London polling stations opened late as staff struggled to get there, and two closed briefly because of flooding but were re-opened in back-up locations. Local media reported some voters had to wade through water to reach a polling station.
"In London/southeast and want to vote in the #EURef? Make sure you plan now to get back to your local polling station by 10pm!" the Electoral Commission said during the evening on Twitter as commuters struggled with train cancellations.
Among those affected was Johnson, who cast his vote with just 25 minutes to spare after returning to the capital from his daughter's graduation in Scotland.
"Let's see, let's see. It's in the hands of the people now," he said when asked how he felt about the vote.
The Leave campaign focused on warnings that Britain would be unable to control immigration levels as long as it was an EU member. Remain said a Brexit would cause economic chaos, impoverish the nation and reduce its clout on the world stage.
The killing of pro-EU lawmaker Jo Cox, a 41-year-old mother of two who was shot and stabbed on a street in her electoral district in northern England a week ago, prompted soul-searching about the vicious tone of the campaign.
Her suspected murderer told a court his name was "Death to traitors, freedom for Britain". Campaigning was suspended for three days out of respect for Cox, resuming on Sunday.
Cameron called the vote in 2013 under pressure from the rebellious anti-EU wing of his Conservative Party and the surging UK Independence Party (UKIP), hoping to end decades of debate over Britain's ties with Europe.
Unless Remain wins by a wide margin, he could struggle to repair the rifts in his party and hold on to his job. He has said he would stay in office but in the event of a vote to leave he is likely to face calls to resign.
Johnson is the bookmakers' favourite to replace him.
A Brexit could also cause the United Kingdom to break up because Scotland, where sentiment towards the EU is much more positive than in England, could hold an independence referendum if it was being dragged out of the EU against its will. Scots voted by 55 to 45 percent against independence in 2014.
OBAMA V TRUMP
After months of non-stop tit-for-tat confrontation between the sides, any substantive debate was over on Thursday. Due to legal restrictions, there were no large-scale campaign events and no television programmes rehearsing the arguments.
Traders, investors and companies were braced for volatility on financial markets whatever the outcome of a vote that has both reflected, and fuelled, an anti-establishment mood also seen in the United States and elsewhere in Europe.
Britain is divided on EU membership along broad age and education lines, polls show. Older and less educated voters tend to favour exit and younger voters and those with higher levels of education lean towards staying.
Whatever the outcome of the vote, the focus on immigration to Britain, which has increased dramatically in recent years, could worsen frictions in a country where the gap between rich and poor has also been widening.
Foreign leaders, from U.S. President Barack Obama to Chinese leader Xi Jinping, have called on Britain to remain in the EU, a message supported by global financial organisations, many company bosses and central bankers.
International banks have warned that the value of the pound could fall dramatically if Britain votes to leave and traders expect markets to be more volatile than at any time since the 2008-9 financial crisis.
(Additional reporting by Estelle Shirbon, Sarah Young, Ana Nicolaci da Costa, Michael Holden, Freya Berry, Ian Chua and Michael Nienaber; writing by Mark Trevelyan; editing by Mark John)
Our Standards: The Thomson Reuters Trust Principles.