By Andrew Osborn and Peter Griffiths
LONDON (Reuters) - Prime Minister David Cameron promised Britons a vote on quitting the European Union, rattling London's biggest allies and some investors by raising the prospect of uncertainty and upheaval.
Cameron announced on Wednesday that the referendum would be held by the end of 2017 - provided he wins a second term - and said that while Britain did not want to retreat from the world, public disillusionment with the bloc was at "an all-time high".
"It is time for the British people to have their say. It is time for us to settle this question about Britain and Europe," Cameron said in a speech, adding that his Conservative party would campaign for the 2015 parliamentary election on a promise to renegotiate the terms of Britain's EU membership.
"When we have negotiated that new settlement, we will give the British people a referendum with a very simple in or out choice to stay in the European Union on these new terms; or come out altogether. It will be an in-out referendum."
A referendum would mark the second time British voters have had a direct say on the issue. In 1975, they decided by a wide margin to stay in, two years after the country had joined.
Most recent opinion polls have shown a slim majority would vote to leave amid bitter disenchantment, fanned by a hostile press, about the EU's perceived influence on the British way of life. However, a poll this week showed a majority for staying.
Cameron's position is fraught with uncertainty. He must come from behind to win the next election, secure support from the EU's 26 other states for a new British role, and hope those countries can persuade their voters to back the changes.
He also avoided saying exactly what he would do if he failed to win concessions in Europe, as many believe is likely.
Critics, notably among business leaders worried about the effect on investment, say that for years before a vote, Britain may slip into a dangerous and damaging limbo that could leave it adrift or effectively pushed out of the EU.
The United States, a close ally, is also uneasy about the plan, believing it will dilute Britain's international clout. President Barack Obama told Cameron last week that Washington valued "a strong UK in a strong European Union" and the White House said on Wednesday it believed Britain's membership of the EU was mutually beneficial.
Some of Britain's European partners were also anxious and told Cameron on Wednesday his strategy reflected a selfish and ignorant attitude. However, Angela Merkel, the leader of EU paymaster Germany, was quick to say she was ready to discuss Cameron's ideas.
French Foreign Minister Laurent Fabius was less diplomatic: "If Britain wants to leave Europe, we will roll out the red carpet," he quipped, echoing words Cameron used recently to urge France's rich to escape high taxes and move to Britain.
French President Francois Hollande repeated his refusal of special deals: "What I will say, speaking for France, and as a European, is that it isn't possible to bargain over Europe to hold this referendum," he said. "Europe must be taken as it is.
"One can have it modified in future but one cannot propose reducing or diminishing it as a condition of staying in."
Italian Prime Minister Mario Monti was more positive. He said he agreed with Cameron on the need to make the EU more innovative and welcomed the idea of a British referendum, saying he thought Britons would ultimately vote to stay in the bloc.
Billed by commentators as the most important speech of Cameron's career, his referendum promise ties him firmly to an issue that has bedeviled a generation of Conservative leaders.
In the past, he has been careful to avoid bruising partisan fights over Europe, an issue that undid the last two Conservative prime ministers, John Major and Margaret Thatcher.
His speech appeared to pacify a powerful Euroskeptic wing inside his own party, but deepen rifts with the Liberal Democrats, the junior partners in his coalition. Their leader, Deputy Prime Minister Nick Clegg, said the plan would undermine a fragile economic recovery.
Sterling fell to its lowest in nearly five months against the dollar on Wednesday as Cameron was speaking.
Cameron said he would take back powers from Brussels, saying later in parliament that, when it came to employment, social and environmental legislation, "Europe has gone far too far".
But such a clawback - still the subject of an internal audit to identify which specific powers he should target for repatriation to London - is likely to be easier said than done.
If Cameron wins re-election but then fails to renegotiate Britain's membership of the EU, a 'Brexit' could loom.
Business leaders have warned that years of doubt over Britain's EU membership would damage the $2.5 trillion economy and cool the investment climate.
"Having a referendum creates more uncertainty and we don't need that," Martin Sorrell, chief executive of advertising giant WPP, told the World Economic Forum in Davos. "This is a political decision. This is not an economic decision.
"This isn't good news. You added another reason why people will postpone investment decisions."
Cameron has been pushed into taking such a strong position partly by the rise of the UK Independence Party, which favors complete withdrawal from the EU and has climbed to third in the opinion polls, mainly at the expense of the Conservatives.
"All he's trying to do is to kick the can down the road and to try and get UKIP off his back," said UKIP leader Nigel Farage.
Euroskeptics in Cameron's party, who have threatened to stir up trouble for the premier, were thrilled by the speech.
Conservative lawmaker Peter Bone called it "a terrific victory" that would unify 98 percent of the party. "He's the first prime minister to say he wants to bring back powers from Brussels," Bone told Reuters. "It's pretty powerful stuff".
Whether Cameron holds the referendum remains as uncertain as the Conservatives' chances of winning the election. They trail the opposition Labour party in opinion polls, and the coalition is grappling with a stagnating economy as it pushes through unpopular public spending cuts to reduce a large budget deficit.
Labour leader Ed Miliband said on Wednesday his party did not want an in-or-out referendum.
Cameron said he would campaign for Britain to stay in the EU "with all my heart and soul", provided he secured the reforms he wants. He made clear the Union must become less bureaucratic and focus more on free trade.
It was riskier to maintain the status quo than to change, he said: "The biggest danger to the European Union comes not from those who advocate change, but from those who denounce new thinking as heresy," he said.
Asked whether, if he did not succeed in his renegotiation strategy, would recommend a vote to take Britain out, he said only: "I want to see a strong Britain in a reformed Europe.
"We have a very clear plan. We want to reset the relationship. We will hold that referendum. We will recommend that resettlement to the British people."
Cameron said the euro zone debt crisis was forcing the bloc to change and that Britain would fight to make sure new rules were fair to the 10 countries that do not use the common currency, of which Britain is the largest.
Democratic consent for the EU in Britain was now "wafer thin", he said:
"Some people say that to point this out is irresponsible, creates uncertainty for business and puts a question mark over Britain's place in the European Union. But the question mark is already there: ignoring it won't make it go away."
A YouGov opinion poll on Monday showed that more people wanted to stay in the EU than leave it, the first such result in many months. But it was unclear whether that result was a blip.
Paul Chipperfield, a 53-year-old management consultant, said he liked the strategy: "Cameron's making the right move because I don't think we've had enough debate in this country," he said.
"We should be part of the EU but the EU needs to recognize that not everybody's going to jump on the same bandwagon."
Asked after the speech whether other EU countries would agree to renegotiate Britain's membership, Cameron said he was an optimist and that there was "every chance of success".
"I don't want Britain to leave the EU," he told parliament later. "I want Britain to reform the EU."
In the 1975 referendum, just over 67 percent voted to stay inside with nearly 33 percent against.
(Additional reporting by Paul Taylor in Davos, Alexandra Hudson in Berlin, Brenda Goh in London, Jeff Mason in Washington and James Mackenzie in Rome; Editing by Guy Faulconbridge, David Stamp and Alastair Macdonald)