The UK will vote on whether to remain in the EU on Thursday 23 June, Prime Minister David Cameron has said.
The prime minister made his historic announcement in Downing Street after briefing the cabinet.
He said he would be campaigning to remain in a reformed EU - and described the vote as one of the biggest decisions "in our lifetimes".
Ministers immediately divided up into the leave and remain camps as the campaigns got under way in earnest.
The referendum date announcement comes after renegotiations on the UK's relationship with Europe were finalised on Friday night after 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, include changes to migrant welfare payments, safeguards for Britain's financial services and making it easier to block unwanted EU regulations.
Some Conservative MPs have announced their intention to back the prime minister. The Labour Party, SNP, Plaid Cymru and the Lib Dems are also in favour of staying in.
But many Conservatives have announced they will back the leave campaign including Mr Cameron's long-time ally, Justice Secretary Michael Gove.
London Mayor Boris Johnson, who has previously been a Eurosceptic, has yet to declare where he stands.
On Sunday, he is expected to confirm he will campaign for out, but has told friends he is genuinely conflicted, BBC political editor Laura Kuenssberg says.
Number 10 is resigned to him opposing them following a meeting this week, at which he was disappointed with Mr Cameron's plans, our editor adds.
Mr Johnson has also discussed his decision with Mr Gove.
According to the latest opinion polls, the British public are thought to be fairly evenly split.
By BBC political editor Laura Kuenssberg
Despite the polite promises of civilised debate, Mr Cameron is risking the unity of his party with the referendum.
Cabinet ministers like Iain Duncan Smith and Michael Gove, finally allowed to speak out today, rushed straight from Downing Street to work the phones for one of the leave campaigns.
The gang of six who posed awkwardly for photographs could well become seven when Boris Johnson breaks his continuing silence.
But whatever the individual calculations, expressions of opinion on either side are dwarfed by what today's announcement finally confirms - that in 123 days British voters have the chance to choose to step away from one of the institutions that has shaped our laws, and all of our lives, for more than 40 years.
In his statement, Mr Cameron warned that leaving the EU would be a "leap in the dark" as he urged voters to back his reform deal.
"The choice is in your hands - but my recommendation is clear. I believe that Britain will be safer, stronger and better off by remaining in a reformed European Union."
Home Secretary Theresa May said the EU was far from perfect but "for reasons of security, protection against crime and terrorism, trade with Europe, and access to markets around the world" it was in the national interest to remain in.
Mr Gove said it had been the most difficult decision of his career to go against the prime minister, but he believed "our country would be freer, fairer and better off outside the EU". He added: "Far from providing security in an uncertain world, the EU's policies have become a source of instability and insecurity."
Commons leader Chris Grayling, another leave campaign backer, said: "I actually believe the EU is holding this country back. We cannot control our borders, limit the number of people who come here do trade deals.
"I do not believe we can take decisions in the national interest when we are part of the European Union."
He said the prime minister had "put in a Herculean effort to try to deliver change" to Britain's relationship with the EU, but the "concessions" he had brought back from Brussels did not "give us the opportunity to take decisions in the national interest" without consulting Brussels.
Culture Secretary John Whittingdale, Work and Pensions Secretary Iain Duncan Smith, Northern Ireland Secretary Theresa Villiers and Employment Minster Priti Patel, who is not a full cabinet member but attends meetings, have also joined the leave campaign.
Energy Minister Andrea Leadsom - who is not a member of the cabinet - will also back the leave campaign.
The rest of the cabinet joined Mr Cameron in the remain camp, including Business Secretary Sajid Javid - previously seen as a potential leave supporter.
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, they argue, the EU has changed a lot over the past 40 years.
The organisation has extended its control and now sets rules in a wide range of areas - including on the environment, transport and consumer rights.
David 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.
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.
The key points of Mr Cameron's reform deal are:
- an "emergency brake" on migrants' in-work benefits, with payments phased in during their first four years in a new country, when there are "exceptional" levels of migration. The UK will be able to operate the brake for seven years
- child benefit for the children of EU migrants living overseas will now be paid at a rate based on the cost of living in their home country - applicable immediately for new arrivals and from 2020 for the 34,000 existing claimants
- The amending of EU treaties to state explicitly that references to the requirement to seek ever-closer union "do not apply to the United Kingdom", meaning Britain "can never be forced into political integration"
- The ability for the UK to enact "an emergency safeguard" to protect the City of London, to stop UK firms being forced to relocate into Europe and to ensure British businesses do not face "discrimination" for being outside the eurozone
The Labour Party is officially campaigning for Britain to remain in the EU, although a small group of the party's backbenchers have 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".
Scotland's First Minister Nicola Sturgeon said in a statement the SNP will be "leading the positive case to keep Scotland in the EU".