The UK has voted to leave the European Union, with the official result of 51.9% voting for a Brexit, while 48.1% voted to remain.

Following the news of the referendum, Prime Minister David Cameron has announced he is to step down by October after the defeat.

The PM had urged the UK to stay within the EU, and was backed by London, Scotland and Northern Ireland, who all voted to remain. Howver, the majority of England and Wales had the deciding factor by voting leave.

The referendum voter turnout was 71.8%, with more than 30 million people voting and was the highest turnout in a UK vote since 1992. The total Leave vote resulted in 17,410,742, while Remain’s total was 16,141,241.

Despite pleas for David Cameron to stay on, regardless of the result, from leave campaigners Boris Johnson and Michael Gove – who are expected to be among the contenders to lead the Conservative party after Cameron, and potentially the next PM, David Cameron revealed his decision to resign.

In an emotional statement, Cameron said: “The British people have made a very clear decision to take a different path and as such I think the country requires fresh leadership to take it in this direction.

“I will do everything I can as Prime Minister to steady the ship over the coming weeks and months but I do not think it would be right for me to try to be the captain that steers our country to its next destination.

“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.

“There is no need for a precise timetable today but in my view we should aim to have a new prime minister in place by the start of the Conservative Party conference in October.”

Read the EU Brexit timeline on today's events.