As part of the Mile End Institute's referendum instant analysis, Dr Robert Saunders, Lecturer in Modern British History at QMUL, considers the historical context of the vote.
When an earthquake has gone off in British politics, it seems sensible to let the dust settle before making grand pronouncements about the future.
And when emotions are still very raw, it is hard to look dispassionately at the campaign that has passed.
Instead, what I attempt here is to set the result in a longer perspective, writing as a historian of British democracy and (more recently) of Britain and the EU.
A Crisis of Parliaments
The referendum has exposed - but not created - a crisis in our representative system.
That crisis has been building for some time, but has now erupted in full force.
The electorate in England and Wales has repudiated the judgement, not just of the Prime Minister, but of the Leader of the Opposition, four-fifths of the Cabinet, three-quarters of all Members of Parliament and the leaders of every major national party in the Commons.
The chasm between the views of the electorate and of the people elected to represent them has never been more brutally exposed.
That has propelled our democracy into wholly uncharted waters. There is simply no precedent for a Parliament that is so out of kilter with the electorate, just one year after a general election, on the most important political question of the day.
The result marks a public vote of no confidence, not just in David Cameron, but in MPs, trade unions, big business, the universities, economists and ‘experts’ of all kinds.
This is a seismic moment for our entire political culture.
What happened last night has been building for half a century. Trust in politicians is at a catastrophic low.
Many voters no longer recognise themselves in the political class, and they no longer associate with any of the main parties.
There was a warning shot in the general election of 2015, for an electoral system that gave just one Member of Parliament to four million UKIP voters had become dangerously detached from its constituents.
Yet the fuse had been burning for decades.
From 1951 to 2010, the percentage of the electorate voting for Labour or the Conservative party dropped by a third.
As a percentage of the total electorate (all those who could have voted, had they chosen to do so) it fell by almost half - from 80% to 42%.
That was disguised by the electoral system, which continued to dish out handsome majorities on ever-diminishing vote shares, but the iceberg was slowly melting. Yesterday, it came crashing down into the sea.
Challenges of Government
The implications are no less momentous for the history of diplomacy.
The vote overturns the entire course of British foreign policy since 1961.
Every government for half a century has backed membership of the European Community, and it has done so for the same basic reason.
Since the Second World War, all administrations have grappled with the question of how Britain could exert influence in the world once its imperial status had expired.
This was the dilemma articulated by Dean Acheson in 1962, when he suggested that Britain had 'lost an empire, and not yet found a role'.
For every prime minister since Harold Macmillan, the answer has been that Britain should lead in Europe.
That choice has now been rejected, but finding a new answer will not be straightforward. Britain applied to the EEC in the first place after an exhaustive pursuit of the alternatives.
It had tried and failed to build a new power-base in the Commonwealth; it had failed to achieve a free trade arrangement with the Community; and it had discovered the limits of the 'Special Relationship' when Washington wanted influence on the Continent.
Politicians must now succeed where their predecessors fell short.
They will have to do so amidst a wider challenge of governability.
As we are about to discover, four decades of membership have left a deep impression on British history.
The EU has penetrated almost every area of public life, whether that means the peace process in Northern Ireland, gay rights, de-industrialisation, the legal system, regional policy, the devolution settlement, the arts, higher education or nationalist politics.
The effects will be felt in areas of policy that have not even occurred to us thus far.
Disentangling all this will be one of the most complicated exercises ever undertaken by the British state.
In some important areas, such as trade policy, the British government has very little institutional expertise: it has simply not had to do this since the early 1970s.
Other issues, such as the constitutional status of Northern Ireland, will involve negotiations of extraordinary political sensitivity.
Assuming that Boris Johnson succeeds David Cameron, the government will be doing this under a prime minister who has never held a job in national government. Here, again, this is uncharted terrain.
The road ahead
What happened was something genuinely historic: the repudiation, at a stroke, of the policy of every British government for fifty years.
It has toppled the prime minister and could conceivably claim Jeremy Corbyn.
Even for those of us who regret the voters' decision, the fact that it was possible for them to do this, without violence, is a remarkable expression of democracy.
The challenge now is to close the gap between our representative democracy and our popular democracy.
At present, they resemble two alien tribes, looking at one another through a toxic mist of revulsion, incomprehension and dismay.
This blog was first published on the Gladstone Diaries.