After months of tantric teasing, the prime minister used a speech in central London early on Wednesday morning to set out his vision to claw back powers from Brussels to Westminster and then put the new relationship to a public vote by October 2017.
In what could be one of the defining speeches of his time in Downing Street, the prime minister said: "It is time for the British people to have their say, it is time for us to settle this question about Britain and Europe".
"I say to the British people: this will be your decision. And when that choice comes, you will have an important choice to make about our country's destiny," he added.
"Those who refuse to contemplate consulting the British people would, in my view, make our exit more likely" he said.
However he rejected calls to hold a referendum immediately. "A vote today between the status quo and leaving would be an entirely false choice," he said.
"While the EU is in flux is not the time to make such a momentous decision about the future of our country. It is wrong to ask people to stay or go before we have had a chance to put the relationship right."
The offer of an in or out referendum will be seen as a crucial concession to backbench Tory MPs, many of whom would have been happy with nothing less.
- David Cameron Promises In Or Out EU Referendum If Tories Win 2015 Election
- EU Speech: Tory MPs Welcome David Cameron's 'Historic' Referendum Pledge
- BLOG: EU Vote: Stay in 40%, Leave 34%
- Cameron's EU Speech In Full
- No Time To Read All Of Cameron's EU Speech?
- BLOG: The UK Must Remain at the EU Table - the PM is Right
- Revealed: Three EU Referendum Questions The Tories Are Considering
- 'We'll Roll Out The Red Carpet For British Businessmen'
- WATCH: Nick Clegg Attacks 'Grinding Uncertainty' Of Referendum
Amid concerns in Tory circles that Cameron faces a uphill battle to remain in office, let alone win an outright majority in 2015, the speech will also be used to campaign against Nigel Farage's Ukip.
Tory MP George Eustice, who used to be Cameron's press secretary, told BBC Newsnight: "If you do want a new settlement with Europe and you do want a referendum, you have to get behind the Conservative Party."
A referendum is not guaranteed as both Labour and the Lib Dems are opposed. It is unclear if Nick Clegg would agree to let Cameron hold a referendum if the prime minister fails to win a majority and has to form a second coalition.
Asked if he would make a it a 'red line' issue in any future coalition negotiations, Cameron said: "If I am prime minister, this will happen."
Despite offering a referendum, Cameron said he intends to campaign strongly for Britain to remain part of the bloc.
“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.
"We can deliver a more flexible, adaptable and open European Union in which the interests and ambitions of all its members can be met.
"Over the coming weeks, months and years, I will not rest until this debate is won. For the future of my country. For the success of the European Union. And for the prosperity of our peoples for generations to come."
The prime minister had originally planned to deliver the speech in Amsterdam on Friday but cancelled the trip in the wake of the terror attack on an Algerian gas field.
However extracts from the speech had already been briefed to journalists before it was delayed, meaning some of the key lines were still reported.
Cameron said that while he was in favour Britain being part of the EU, there was a danger the British people will “drift towards the exit” if it is not reformed.
"I do not want that to happen. I want the European Union to be a success and I want a relationship between Britain and the EU that keeps us in it,” he said.
"People are increasingly frustrated that decisions taken further and further away from them mean their living standards are slashed through enforced austerity or their taxes are used to bail out governments on the other side of the continent," he was intending to argue.
The prime minister’s position has exposed a deep rift within the coalition, with the Lib Dems rejecting the case for holding a referendum.
In a high profile speech on Thursday, business secretary said a referendum at this time would cause “uncertainty” and severely damage the UK’s fragile economic recovery.
Cameron has also come under pressure from foreign leaders including president Obama not to take Britain out of the EU.
A White House spokesman said: "The president underscored our close alliance with the United Kingdom and said that the United States values a strong UK in a strong European Union, which makes critical contributions to peace, prosperity, and security in Europe and around the world."
European politicians have also encouraged Cameron to ignore his Eurosceptic MPs. Writing on The Huffington Post UK, the president of the European Parliament said Cameron’s stance could lead to the “disintegration and potentially the break-up of the EU”.
And former Belgian prime minister Guy Verhofstadt told HuffPost UK that Cameron was a “madman, threatening to blow himself up unless he gets his own way”.
On Tuesday evening Ed Miliband savaged Cameron’s speech, saying it would “define him as a weak prime minister, being driven by his party, not by the national economic interest”.
"In October 2011, he opposed committing to an in/out referendum because of the uncertainty it would create for the country. The only thing that has changed since then is he has lost control of his party and is too weak to do what is right for the country,” he said.
Related on HuffPost:
Suggested For You
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements. Learn more