It's no secret that Theresa May lost her majority in June's election and that Jeremy Corbyn won more seats than expected. But what was really behind the decisions made by the UK's voters?
For the past three years the British Election Study has followed a panel of the same 30,000 voters - asking them hundreds of questions about their political views and choices on 13 occasions.
It offers the most detailed look at the issues which most concerned the electorate - and the results are now in.
It really was about Brexit
Despite Mrs May's claim that her reason for calling an early election was to get a mandate for the Brexit negotiations, the issue of Brexit itself had a relatively low profile during campaigning.
For much of the campaign, both the Conservatives and Labour focused on other issues.
But in the minds of the voters at least, the 2017 election was - as it promised to be ever since the referendum of June 2016 - the Brexit election.
This can be seen in our data in many different ways, but nowhere more clearly, perhaps, than in the answer to the question: "As far as you're concerned, what is the single most important issue facing the country at the present time?"
More than one in three people chose Brexit or the EU, compared with fewer than one in 10 who mentioned the NHS and one in 20 who suggested the economy.
The Europe question boosted the Tories and Labour
Of course, actions speak louder than words, and voters were not only concerned by Brexit but actually voted accordingly.
The issue cut across normal party loyalties and contributed to the revival of the Conservative and Labour parties at the expense of challenger parties - including UKIP, the SNP, Plaid Cymru and the Greens - which had done so well in 2015.
Because the British Election Study tracked the same voters during the 2015 election, the EU referendum and the 2017 election, we can see for the first time how voters switched party allegiance depending on their referendum vote.
The Conservatives' position on Brexit, coupled with the absence of Nigel Farage, saw the UKIP vote collapse and the majority of its support go to the Tories.
More than half of UKIP's 2015 voters who voted again in 2017 switched to the Conservatives, compared with only 18% to Labour and a further 18% who stayed loyal.
Labour picked up a few Leave voters, but lost roughly equal numbers to the Conservatives - undoubtedly the party of Leave.
But which was the party of Remain?
Despite having the clearest pro-EU position and a promise of a second referendum, the Liberal Democrats failed to pick up many more Remain voters than they lost.
Instead, Labour, which was already the most popular party in 2015 among those who voted Remain in 2016, scooped the lion's share.
Despite uncertainty over its position on the single market, Labour was seen as the best bet by those wanting to keep closer ties with Europe.
Not only did it win over a large number of Remainers from the Conservatives, but also from the pro-EU Greens and Lib Dems.
Overall, nearly two-thirds of 2015 Greens went to Labour, as well as about a quarter of Liberal Democrats.
How to say goodbye
One of the reasons Labour did so well among Remainers is that by the time the election was called, the Brexit debate was not so much about Leave or Remain but about how to leave.
The tens of thousands of voters we surveyed were asked whether it was more important for the government to "protect Britain's access to the single market, or to gain full control of immigration".
The results reveal a striking correlation between wanting to control immigration and voting Tory on one hand, and wanting access to the single market and voting Labour or Lib Dem on the other.
For example, the Conservatives lead Labour by more than 40 percentage points among those most in favour of full control of immigration, with Labour having a similar lead among those wanting complete access to the single market.
In effect this meant the Tories were the party of hard Brexit, while Labour was the party of soft Brexit.
The Lib Dems were not the first choice for those favouring a soft Brexit - possibly because of the lingering effects of coalition government, a perception of ineffective leadership and a realisation that they could not win in most seats.
Although this was a Brexit election, it would be clearly wrong to say the election outcome was determined back in June 2016.
More than at any British election in recent memory, the election campaign really did matter.
Our pre-election survey, carried out in April and May, found that the Conservatives enjoyed a healthy lead over Labour of 41% to 27%.
But by the last three days of the campaign, our daily panel put the two main parties neck and neck.
Overall, 19% of voters switched parties between the April/May survey and the election.
This is similar to the amount of "churn" we saw in 2015, when 17% of voters switched parties, and slightly less than at the 2010 and 2005 elections.
But the significant difference in 2017 was that the flow was overwhelmingly in one direction.
In 2015, Labour and the Conservatives both won about a quarter of these late-switching voters - effectively cancelling each other out.
However, in 2017 Labour won 54% of switchers, compared with 19% for the Conservatives.
Additionally, Labour won more than half of those who hadn't made up their minds before the campaign.
A question of leadership
The main reason that Labour did so well during the campaign is the strong performance of Jeremy Corbyn, especially relative to Theresa May.
At the start of the campaign, Mr Corbyn lagged far behind Mrs May in leader "like scores" - in which voters award a mark out of 10.
Mr Corbyn's score of 3.5 was slightly worse than predecessor Ed Miliband's at a similar point in 2015. However, by the end of the campaign Mr Corbyn had caught up with Mrs May, with both on 4.4.
And although Mrs May was still rated as the leader who would make the best prime minister, the gap had narrowed considerably.
Mr Corbyn's strong performance - or perhaps Mrs May's poor campaign - also meant that Labour closed the gap with the Conservatives when voters were asked which party was best placed to handle the issue they considered the most important for the country.
Over the course of the campaign Labour managed to broaden its appeal, winning over voters who were initially rather lukewarm about Mr Corbyn.
Labour also widened its appeal to more moderate voters on a number of issues, dramatically narrowing the gap with the Conservatives.
During the campaign, previously undecided left-leaning voters and supporters of a soft Brexit were most likely to switch to Labour.
Many of these had previously voted Labour in 2010 and 2015 and so perhaps were "coming home".
While this was undoubtedly the Brexit election, it was also a tale of two leaders and a campaign that mattered.
The Conservative strategy to pin so much on their "strong and stable" leader appears to have been a spectacular mistake which ultimately cost them an overall majority.
About this piece
This analysis piece was commissioned by the BBC from experts working for an outside organisation.
Prof Ed Fieldhouse and Dr Chris Prosser are members of the British Election Study team at the University of Manchester.
The British Election Study is managed by a consortium of the University of Manchester, the University of Oxford and the University of Nottingham, and has carried out studies of voter behaviour at every election for the past 50 years.
Charts produced by Edwin Lowther and Arvin Supriyadi
Edited by Duncan Walker