"Once that new settlement has been negotiated, we will give the British people a referendum with a very simple in-or-out choice to stay in the EU on these new terms. Or come out altogether," Cameron said.
The speech was seen by many as a gamble to shore up support from Cameron's fractured, increasingly anti-EU party that risked antagonizing other countries focused on stemming the eurozone debt crisis.
The fiercely independent island nation has never been an enthusiastic member of the bloc, seeing itself as culturally different and balking at having policy dictated by Brussels. But the drumbeat has grown over fears that new EU regulations to address the debt crisis will further restrict the country's control over its own economic policies.
Many EU member states, which had in the run-up to the speech stressed the importance of Britain's presence in the bloc, took a sharper tone after Cameron spoke.
Martin Schulz, the president of the European Parliament, said that Cameron was playing "a dangerous game" and accused him of playing domestic politics.
"This was an inward-looking speech that does not reflect European reality and will not impress many of the U.K.'s European partners," Schulz said.
French Foreign Minister Laurent Fabius likened the EU to joining a soccer club - "you can't say you want to play rugby," he told France-Info radio.
Britain does not use the euro currency, but membership in the EU has given the U.K. access to the massive joint European market as well as a say in how the region should govern itself and run its financial markets. The country has also benefited from EU funds to build infrastructure such as broadband networks.
German Foreign Minister Guido Westerwelle said his country wants Britain "to remain an active and constructive part" of the EU, but suggested that countries could not be allowed to write their own terms for EU membership, saying "a policy of cherry-picking won't function."
Cameron stressed that his first priority is renegotiating the EU treaty - not leaving the bloc.
"I say to our European partners, frustrated as some of them no doubt are by Britain's attitude: Work with us on this," he said.