A wave of shock is reverberating around Europe as countries across the EU and beyond digest the decision by UK voters to leave the European Union.
BBC correspondents across the continent report on the reaction and the likely effect the result will have.
Biggest crisis yet for Brussels - by Chris Morris
This represents the biggest setback in decades for those who support the idea of European unity. The EU will be changed forever.
It has already been dealing with multiple crises in recent years - but this could, and probably will, dwarf them all.
The President of the European Council, Donald Tusk, said it was not a moment for hysterical reaction. But speaking on behalf of the leaders of the other 27 EU countries, he said they were all determined to maintain their unity
Veteran European politician Carl Bildt has already spoken of immediate turmoil and long-term uncertainty.
The divorce negotiations will last at least two years - a vastly complicated legal and political process.
The rest of the EU will want to forge a good deal with the British government, but in many capitals there will be little appetite for doing the UK any favours. That's partly because Euroscepticism is on the rise across the continent, and influential political leaders will not want to give the impression that leaving is easy.
France and Germany - along with other like-minded countries - may now try to push ahead with further integration in some areas, without the UK holding them back. But for the moment they are trying to digest the fact that Europe's political order has been overturned - with far-reaching consequences that no-one can accurately predict.
Shock for France - by Lucy Williamson, Paris
Despite all the irritation expressed here towards Britain's relationship with the EU, news that one of the bloc's largest members is leaving will come as a shock, with real implications for the country's own political debate.
Far-right National Front leader Marine Le Pen was among the first to respond with a cry of "victory for freedom!" Now it was time for a referendum in France and elsewhere in the EU, she tweeted. Her niece and party colleague, Marion Marechal-Le Pen, said Europe would be a "major theme" in next year's presidential elections.
That's something both the established mainstream parties here are concerned about. Just before the British vote, President Francois Hollande issued harsh warnings about the consequences of a Brexit, saying it could jeopardise Britain's access to the single market.
In the meantime, France and the UK are facing the prospect of new bilateral discussions on everything from trade ties, to residency rights for expats. And there have also been some politicians calling for Paris to scrap the Le Touquet agreement which governs the processing of UK-bound migrants in Calais.
Dismay in Germany - by Jenny Hill, Berlin
"Damn! A bad day for Europe!" tweeted Sigmar Gabriel. Germany's vice-chancellor spoke for the majority here; there is dismay and shock in Berlin and a general consensus that this is a bad decision for Britain, for Germany and for Europe.
Germany has long considered Britain a significant political ally in the EU; a counterweight to its own dominance.
There are fears for the German economy: the country's exporters association has described the decision as a "catastrophe". And there are fears for the future of the union.
Speaking on German television this morning, the president of the European parliament Martin Schulz said that Brexit would not precipitate a domino effect across Europe.
But - in an early indication of what kind of support Britain can expect as it negotiates its exit - one of Chancellor Angela Merkel's senior MPs told me that there would be consequences for Britain. Peter Beyer said that it was important to discourage other member states from heading for the door.
Uncertainty in Dublin - by Shane Harrison
This is not the outcome the Republic of Ireland wanted.
The Irish government, which remained neutral in the Scottish independence referendum, actively encouraged Irish citizens in the UK to vote to remain in the EU.
The cabinet will meet this morning to consider what it calls the "very significant implications" for Ireland, Britain and the EU. Then Taoiseach (Prime Minister) Enda Kenny will make a public statement.
With uncertainty over what happens next and how long the process of UK EU withdrawal will take, there will be concern in Dublin about what the vote means for the border with Northern Ireland, the impact of a weakening sterling and the effect on trade, which is estimated at over €1bn between the two states every week.
Sinn Fein, which has MPs on both sides of the border, has called for vote on whether Northern Ireland should remain part of the UK or should become part of a united Ireland. But that is unlikely to be a priority for the Irish government, which does not believe a vote for a united Ireland is likely to get enough support.
In the course of the campaign Irish ministers disagreed with Northern Ireland Secretary Teresa Villiers about whether the border would be "hard" or "soft" if the British decided to leave.
Dublin said some a form of border control, whether on the border or at airports and ports, was likely to be re-introduced because the Republic is the only EU state to share a land border with the UK.
Nervous time for Greeks - by Richard Galpin in Athens
The Greek stock market has fallen sharply this morning on the news that Britain has voted to leave the European Union.
The Athens stock exchange fell 15% immediately after opening, with bank shares plummeting 30%, the maximum permitted before trading is suspended.
The volatility will add to concerns that Brexit could be followed by Grexit - Greece leaving the eurozone.
The Greek economy is very fragile, and before the referendum experts here had warned that a leave vote could have a knock-on effect on the Greek economy.
This is partly based on what has been happening to the pound, which has fallen sharply in value against the euro and the dollar.
If this turns out to be a long-term phenomenon then the vital tourism industry in Greece could be hit. British holidaymakers make up the largest contingent of foreign visitors to this country and may now be deterred from coming - because it will be more expensive.
There are also fears that Greek exports to Britain will be hit. Experts believe these factors and the anticipated turbulence across European markets could sink the weak Greek economy.
Calls for calm in Spain - by Sarah Rainsford in Malaga
Spaniards are firm believers in the European project and big traders with Britain. So, as the country woke to the news of Britain's vote and the stock market plunged, acting Prime Minister Mariano Rajoy called for calm. Spain, he insisted, will weather any turmoil.
But this country is also home to hundreds of thousands of British expatriates. Whilst tourists cheered British "independence" over their full English breakfasts, British residents here worried about what the decision means for their right to live and work in the EU and get free healthcare.
The reality is, no-one knows yet. There is also concern about the plunging pound: that tourists will spend less in the British-run bars, and older expats will struggle on their UK pensions.
Gibraltar may have even more to worry about.
After an emphatic vote to remain in the EU by the Rock's British residents, Spain's acting foreign minister said the decision to leave opened up "new possibilities" over its status. The prospect of a Spanish flag flying on the Rock, said Jose Manuel Garcia-Margallo, was "much closer" now.
Dutch fear contagion - Anna Holligan in The Hague
The Netherlands is among the nations with the most to lose from Brexit. One study estimated an economic hit of €10bn by 2030.
And with the loss of a vital ally within the EU and a powerful counterbalance to the dominant, federalist tendencies of France and Germany, it is little surprise that Dutch Prime Minister Mark Rutte is locked in talks in Brussels.
His political adversary Geert Wilders - the leader of the anti-Islam, anti-immigration Freedom Party - was among the first to congratulate Britain on its "Independence Day". He promised if he were elected, the Dutch would be granted their own "Nexit" referendum. Fears of contagion are reverberating across the channel.
'Russia's not to blame' - by Steve Rosenberg in Moscow
Ahead of the referendum Russia had become caught up in the Brexit debate.
The Remain campaign had argued that Britain should stay in the EU, alleging the Kremlin was backing Leave to weaken the EU.
The message from Moscow on Friday was clear: Don't blame Russia for this result. The head of the Russian parliament's foreign affairs committee, Alexei Pushkov, tweeted: "Russia has nothing to do with this. It's the defeat of Remain. And a personal failure for Barack Obama."
Pro-Kremlin radio station Vesti FM declared sarcastically, "From the 1990s onwards, we sent our people especially to London, so that 15 years later they could play a decisive role in this referendum. What a load of rubbish!"
But some Russian politicians couldn't contain their pleasure. They included Moscow's Mayor, Sergei Sobyanin, who noted: "Without the UK in the EU, there's no one there who'll back sanctions against us so stridently."
Ultra-nationalist MP Vladimir Zhirinovsky said the British public "had performed a heroic deed". He said he intended to send a congratulatory telegram to David Cameron: "Dear David, our big friend, we're happy that Britain made the right choice."