People in the United Kingdom will vote on whether to remain in the European Union on 23 June, Prime Minister David Cameron says.
Speaking on the steps of 10 Downing Street, he described the referendum as one of the biggest decisions the country would face.
Mr Cameron said the Cabinet had approved a government position recommending Britain stay in a reformed EU.
He said a deal hammered out at a two-day summit in Brussels would give Britain "special status" within the bloc.
Ministers immediately divided into the leave and stay camps as campaigns got under way in earnest. Some senior ministers, including Mr Cameron's long-time ally, Justice Secretary Michael Gove, will campaign for Britain to leave the 28-country bloc.
The referendum announcement comes after renewed negotiations on the UK's relationship with Europe were finalised on Friday night, following intense wrangling at a two-day summit in Brussels.
The agreement, which will take effect immediately if the UK votes to remain in the EU, includes changes to migrant welfare payments, safeguards for Britain's financial services and making it easier to block unwanted EU regulations.
Stay or leave?
Some Conservative MPs say they will back the prime minister. The Labour Party, Scottish National Party, Plaid Cymru and the Lib Dems are also in favour of staying in.
London Mayor Boris Johnson, who has previously been a Eurosceptic, has yet to declare where he stands.
The Labour Party is officially campaigning for Britain to remain in the EU, although a small group of the party's backbenchers has joined the leave campaign.
Leader Jeremy Corbyn voted for Britain to leave the European Economic Community, as the EU was then known, in 1975, but has since changed his mind, arguing that "it brings investment, jobs and protection for British workers and consumers".
He branded Mr Cameron's negotiations a "sideshow" aimed at appeasing critics in the Conservative Party and said he had missed an opportunity to protect jobs and "stop the spread of low pay".
Mr Corbyn said the Prime Minister's claims of reform were meaningless.
"What Cameron's done is not actually helping anyone - it's not helping about wages, it's not helping about jobs, it's not helping about investment, it does nothing for the steel industry - all of these things he could and should have been doing.
"Instead it's actually an internecine war in the Tory Party that's now being played out across a whole continent."
According to the latest opinion polls, the British public are fairly evenly split.
Brits voted "in" 40 years ago
The UK held a referendum in 1975 shortly after it joined the EU.
The vote was in favour of staying in, but there have been growing calls from the public and politicians for another vote because of major changes to the EU over the past 40 years.
The EU now sets rules in a wide range of areas, including on the environment, transport and consumer rights.
Mr Cameron initially resisted calls for another vote, but in 2013 he changed his mind. At the last election he promised to renegotiate Britain's relationship with Europe ahead of a public vote to decide whether the UK should stay in or leave the EU.
The power of Brussels
Mr Cameron claims his EU reform deal will give Britain "special status" within the bloc - tackling concerns over migrants getting "something for nothing" from the benefit system and exempting the country from the EU drive for "ever-closer union".
But critics say it does nothing to tackle high levels of immigration or take back powers from Brussels.
UKIP Leader Nigel Farage said: "The 23rd is our golden opportunity, let battle be joined. Mr Cameron keeps on telling us that Britain would be better in a 'reformed Europe'. But he fails to point out that there is no reformed European Union on offer here. The prime minister's EU deal is pathetic."
Britain Stronger in Europe released a campaign video accusing leave campaigners of "utter hypocrisy" for attacking Mr Cameron's deal, claiming that many of them have been calling for the same reforms.
Key points of reforms agreed in Brussels
- A seven-year "emergency brake" on migrants' in-work benefits
- Child benefit for the children of EU migrants based on the cost of living in their home country
- EU treaty references to the need to seek ever-closer union do not apply to the UK meaning Britain can never be forced into political integration
- An emergency safeguard to protect the City of London, to stop UK firms being forced to relocate into Europe
-BBC