In his speech, given in London, Cameron said the Conservative party would campaign in the 2015 election with a pledge to renegotiate Britain's EU membership and then put the resulting deal to a referendum, possibly in 2017.
“It will be an in-out referendum," Cameron explained, saying that he would seek repatriation of several EU laws, and enshrine those in a new treaty to be negotiated with Britain's EU partners.
The referendum will depend on Cameron winning the next election at a time when the Conservative leader is currently trailing the opposition Labour party in opinion polls, and governing through a fractious coalition with the pro-European Liberal Democrats.
Cameron said he supported Britain remaining in a looser EU, centred around the single market for goods and services, which British companies want to safeguard.
Eurozone debt crisis as an opportunity
Cameron said efforts to forge closer integration among eurozone countries, prompted by the debt crisis, gives Britain a window of opportunity to renegotiate its terms with the EU in a new treaty.
"The European Union that emerges from the eurozone crisis is going to be a very different body. It will be transformed perhaps beyond recognition by the measures needed to save the eurozone," he said.
“Those of us outside the euro recognise that those in it are likely to need to make some big institutional changes,” said Cameron, adding: “By the same token, the members of the eurozone should accept that we, and indeed all member states, will have changes that we need to safeguard our interests and strengthen democratic legitimacy.”
"Those who want to go further, faster," should be free to do so, Cameron stressed, "without being held back by the others" like Britain.
Putting the pressure on his European counterparts, he added that Britain's future in Europe - in or out - would depend on the results of a renegotiation of the UK’s position in the EU.
This will be a tall order for Britain, which is not alone in setting the EU's agenda. And there is little appetite among other EU countries to offer Cameron retrospective cherry-picking of existing rules.
"He can control neither the timing nor the outcome of the negotiations and in so doing is raising false expectations that can never be met," said Guy Verhofstadt, leader of the liberal ALDE group in the European Parliament. "Cameron is playing with fire."
Cameron acknowledged that he was taking a gamble, saying: "My strong preference is to enact these changes for the entire EU, not just for Britain." But he also added: "If there is no appetite for a new treaty for us all, then of course Britain should be ready to address the changes we need in a negotiation with our European partners."
Cameron would campaign to stay in EU, if conditions met
The UK Conservative leader dismissed suggestions that an in/out referendum on Europe threatened to create business uncertainty, ignoring US warnings over Britain's role in the European Union.
Cameron brushed aside those critics, saying "the question mark" about Britain's position in Europe "is already there and ignoring it won’t make it go away."
"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.
He said resentment at the democratic deficit was angering the UK public, where “democratic consent for the EU in Britain is now wafer thin”. Further delaying a referendum, he warned, “is a path to ensuring that when the question is finally put – and at some stage it will have to be – it is much more likely that the British people will reject the EU.”
When the referendum comes, Cameron said he would campaign for it “with all my heart and soul if we can negotiate such an arrangement”.
“I believe something very deeply. That Britain’s national interest is best served in a flexible, adaptable and open European Union and that such a European Union is best with Britain in it,” he said, calling on his European partners to accommodate his proposals.
A new EU must be built upon five principles, Cameron said: competitiveness, flexibility, power flowing back to - not just away from - member states, democratic accountability and fairness.