By Elizabeth Piper

LONDON (Reuters) - Britons will decide the future of their country and Europe on Thursday in a vote on European Union membership after a bitter campaign that appeared to divide the nation down the middle.

Prime Minister David Cameron called the referendum under pressure from his ruling Conservative Party and an increasingly powerful anti-EU party, hoping to put to rest decades of debate over Britain's place in Europe and its ties with Brussels.

Most opinion polls put the "Leave" and "Remain" camps neck-and-neck at the end of a campaign that was dominated by immigration and the economy and shaken by the murder of a pro-EU MP, though late on Wednesday two showed a swing to "Remain".

The "Leave" campaign says Britain's economy would benefit from a Brexit, or British exit. Cameron says it would cause financial chaos.

Traders, investors and companies are preparing for volatility on financial markets whatever the outcome of a vote that both reflects, and has fueled, an anti-establishment mood also seen in the United States and elsewhere in Europe.

Much will depend on turnout, with younger Britons seen as more supportive of the European Union than their elders but less likely to vote.

"Go out and vote remain for a bigger, better Britain inside a reformed European Union," Cameron told "Remain" campaigners on Wednesday.

His main rival, former London mayor Boris Johnson, whose decision to support "Leave" galvanized its campaign, told voters this was the "last chance to sort this out".

Sterling rose to its highest so far this year against the U.S. dollar late on Wednesday after one poll pointed to a clear lead for "Remain" and betting markets priced in an 80 percent chance Britain would not leave.

Polling stations for 382 local counting areas will open at 0600 GMT and close at 2100, with most of the results expected between around 0100 and 0300 on June 24.

On Wednesday, campaigners from both sides tried to win over the estimated 10 percent of the 46.5 million electorate who polls suggest had still not decided how to vote.

The "In" campaign took aim at their rivals by saying a Brexit would hurt the economy, security and the country's status. The "Out" campaign said high levels of immigration could not be controlled inside the EU and it was time to bring powers back from Brussels to London.

"If we don't vote to leave tomorrow we will remain locked in the back of the car, driven in an uncertain direction, frankly, to a place we don't want to go and perhaps by a driver who doesn't speak the very best of English," said Johnson, a leading candidate to replace Cameron as prime minister.

FOREIGN LEADERS

The murder of lawmaker Jo Cox last week as she prepared to offer advice to those who elected her in northern England, prompted a pause in the campaign and soul-searching about its tone. Her husband said she had been concerned about the coarsening of political dialogue.

The man charged with her murder, asked his name in a London court, responded: "My name is death to traitors, freedom for Britain". A court official referred him to a psychiatrist.

Opinion polls have depicted a deeply divided nation, with big differences between older and younger voters, and between pro-EU London and Scotland and eurosceptic Middle England.

Whatever the outcome of the vote, the focus on immigration to Britain, which has increased significantly in recent years, could worsen divisions in a country where the gap between rich and poor has also been widening.

If Britain chooses to leave, Scottish leader Nicola Sturgeon has suggested Scotland may call a referendum on leaving the United Kingdom.

Even with a vote to stay, Cameron could struggle to repair the rifts in his party and hold on to his job.

Foreign leaders, from U.S. President Barack Obama to Chinese leader Xi Jinping, have called on Britain to remain in the European Union, a message supported by global financial organizations, many company bosses and central bankers.

International banks have warned that the value of the pound could fall dramatically if Britain votes to leave the EU and traders expect markets to be more volatile than at any time since the 2008-09 financial crisis.

The "Out" campaign says a fall in the value of the pound would boost exports and has found support among some financial specialists and small businesses. It has urged voters to ignore what it calls the "establishment" which it says has the most to lose from Brexit.

The EU has struggled with migrant and economic crisis and a Brexit vote would boost opposition to it within other member states.

"Stay with us," European Council President Donald Tusk said in Lisbon on Monday, addressing British voters.

"Without you, not only Europe, but the whole Western community will become weaker. Together, we will be able to cope with increasingly difficult challenges of the future."

(Additional reporting by UK bureau, editing by Philippa Fletcher)