Voters went to the polls on 23 June to decide whether the UK should stay in or leave the European Union.
Here's a look back at the key moments of the campaign for what David Cameron described as one of the biggest decisions "in our lifetimes".
Big beasts assemble
As soon as the date was set on 20 February, the UK's biggest political names began to divide up into the leave and remain camps.
Some Cabinet ministers were straight out of the traps the same day, with Theresa May saying the UK was better off in "for reasons of security, protection against crime and terrorism, trade with Europe" and, for the other side, Michael Gove arguing "our country would be freer, fairer and better off outside the EU".
All eyes were on outgoing London mayor Boris Johnson, about whom speculation had swirled throughout the renegotiation process. On February he declared himself for the leave cause, warning that remaining in the EU would see "an erosion of democracy".
The Sun appeared to have secured a royal scoop on 9 March when it ran the headline "Queen backs Brexit".
The newspaper quoted anonymous sources, one of whom claims to have witnessed a "bust-up" between the Queen and pro-EU former Deputy PM Nick Clegg in 2011.
The palace insisted the Queen was "politically neutral" and launched a complaint about the story.
The press watchdog later found the headline was "significantly misleading". The Sun published the Independent Press Standards Organisation's judgement as required but did not accept they had made a mistake.
Official campaigns named
On 13 April, Vote Leave and Britain Stronger in Europe were designated the official leave and remain campaigns in June's EU referendum.
Vote Leave - backed by Boris Johnson and Michael Gove - saw off a challenge from a rival campaign Grassroots Out, backed by UKIP leader Nigel Farage.
The campaigns were allowed to spend up to £7m, get a free mailshot, TV broadcasts and £600,000 public funds.
Pro-EU membership leaflets costing £9m of public money began to land on doormats in 27 million UK homes in early April, setting out risks of leaving the EU including higher prices of some household goods and lower living standards.
UKIP Leader Nigel Farage said it was "outrageous" to spend taxpayers' money "to tell us how we should think and how we should vote", but the prime minister stressed the government was "not neutral" in the referendum and the cost was "money well spent".
The Treasury released analysis on 18 April saying an EU exit would cost households an average £4,300 a year and the UK economy would be 6% smaller if it left the EU than it would otherwise be by 2030.
Chancellor George Osborne called the report "serious and sober", but leave campaigners said the estimates were "worthless" and "unbelievable" given the Treasury's past record.
Former Conservative Chancellor Lord Lamont, of Vote Leave, said: "Few forecasts are right for 14 months, let alone 14 years. Such precision is spurious, and entirely unbelievable."
Barack Obama intervention
US President Barack Obama made the highest-profile intervention by a foreign leader in the campaign when he said at a press conference on 22 April that Britain would go to the "back of the queue" for trade deals with the US if it votes to leave the European Union.
EU exit campaigners reacted angrily to his words, with Conservative MP Dominic Raab dubbing him a "lame duck" president.
Boris Johnson was also riled by the president's speech - and was eventually forced to apologise for references to his "part-Kenyan" ancestry.
Celebrities speak out
Actors Jude Law, Keira Knightley and Benedict Cumberbatch were among stars to sign a letter on 20 May saying Brexit would "damage" the creative industry - with House of Cards writer Lord Dobbs responding that British success in the industry was "not because of the EU".
Since then, pretty much every public figure has been asked for their view. In June the focus turned to footballers David Beckham, Rio Ferdinand and John Barnes, who said they'd be backing a vote to remain.
And on the leave side luminaries include Sir Michael Caine, John Cleese, Liz Hurley, Sol Campbell and Ian Botham.
A row broke out in May when leave campaigner Penny Mordaunt said on 24 May the migrant crisis would hasten talks over Turkey's EU bid and said the UK was powerless to stop it - a claim David Cameron described as "very misleading".
The prime minister repeatedly insisted it would be "literally decades" before Turkey was deemed ready to join.
But his point has been treated with scepticism by those on the leave side who highlight remarks he made in 2010 when he said the UK would be the "strongest possible advocate" for Turkey joining the EU.
Conservative chair of the health select committee Sarah Wollaston switched allegiances on 9 June, saying Vote Leave's claim that Brexit would free up £350m a week for the NHS "simply isn't true" (they defend the figure).
Labour's Khalid Mahmood also went over to the remain campaign, as did former Conservative Party chair Baroness Warsi.
In the other direction, former defence chief Lord Guthrie changed his mind and joined the leave campaign, saying he was worried by the prospect of "a European army".
Voter registration malfunction
The government was forced to enact emergency legislation to extend the deadline for registering to vote in the EU referendum after a computer glitch which left some people unable to sign up before the original deadline of midnight on 7 June.
The glitch, blamed on record demand, resulted in users encountering a page displaying the message "504 Gateway Time-out" instead of the online registration form.
In the 48-hour extension a further 430,000 people registered to vote and the Electoral Commission later reported the electorate stood at a record 46.5 million.
Battle of the Thames
One of the most surreal scenes of the campaign saw Nigel Farage and Bob Geldof trade insults in a nautical battle as Mr Farage led a flotilla of fishing boats up the Thames to urge Parliament take back control of British waters.
His Brexit armada was greeted by a rival Remain fleet carrying Mr Geldof, who yelled that the UKIP leader was "no fisherman's friend".
Mr Farage accused Mr Geldof of "mocking" impoverished fishermen.
'Breaking point' poster
Nigel Farage and UKIP came under heavy criticism after releasing a poster on 16 June bearing the words "breaking point" and depicting a line of migrants at the Slovenia border.
Baroness Warsi said it was pivotal in her decision to withdraw her support from the leave campaign - but Nigel Farage defended the poster, saying it was "the truth".
He did however apologise for the timing of its launch, which happened on the same day as Labour MP Jo Cox was killed in her constituency.
The BBC's Great Debate
A video compilation of the best moments
That wasn't all, of course. It was also a campaign which took in the number of bananas in a bunch, money for matadors and men in gorilla suits.
On the last day of campaigning Lib Dem leader Tim Farron released his version of John Barnes' rap from the 1990 England World Cup song World In Motion. But perhaps it's best not to dwell on that.
Here's a compilation of the campaign put together for the Daily Politics: