Britain has voted to leave the European Union, in a historic referendum that has shaken the world, and prompted the resignation of Prime Minister David Cameron.
The result, long predicted to be close, ended up 52 percent to 48 percent in favour of leaving.
As the Leave vote pulled ahead during overnight vote-counting, Nigel Farage, the leader of the anti-EU UK Independence Party, told supporters that "dawn is breaking on an independent United Kingdom".
"We have fought against the multinationals, we have fought against the big merchant banks, we have fought against big politics, we have fought against lies, corruption and deceit."
"I hope this victory brings down this failed project and leads us to a Europe of sovereign nation states trading together, being friends together, cooperating together -- and let's get rid of the flag, the anthem, Brussels, and all that has gone wrong."
He tweeted that the vote meant "we've got our country back."
Mr Cameron announced his resignation in a press conference, saying the country needed a new leader to oversee its exit from the European Union.
"I think the country requires fresh leadership to take it in this direction," he said.
"This is not a decision I've taken lightly, but I do believe it's in the national interest to have a period of stability, and then the new leadership required."
Mr Cameron said a new leader should be in place by the Conservative Party conference in October.
He urged those in the defeated Remain camp to support the referendum result.
"I will do everything I can in future to help this great country succeed."
Earlier, as the referendum result became clear, markets tumbled and other European political leaders shared a mixture of reactions, from anger to elation.
Geert Wilders, a Dutch Eurosceptic and anti-Islam politician, called for the Netherlands to hold a referendum on its own EU status.
But Martin McGuinness, of the Irish republican political party Sinn Féin, said all of Ireland should now be able to vote on reunification, after Northern Ireland voted to remain in the EU.