Here's how the night and early morning unfolded as Britain voted to leave the EU in a historic referendum.

https://storify.com/edp24/eu-referendum-night-live

The final result showed 51.9% in favour of Leave and 48.1% for Remain. Leave took 17.4m votes and Remain had 16.1m.

In East England, Leave dominated, taking 330,000 votes to Remain's 220,700 in Norfolk and Waveney.

Eastern Daily Press: Vote counting takes place at St Andrew's Hall, Norwich after the ballot boxes arrived in a fleet of cars.PHOTO BY SIMON FINLAYVote counting takes place at St Andrew's Hall, Norwich after the ballot boxes arrived in a fleet of cars.PHOTO BY SIMON FINLAY (Image: ARCHANT NORFOLK)

Our reporters spent the night and morning at counts across Norfolk and Waveney, as well as Chelmsford where the east of England results are being collected.

The Leave camp has won, scoring wins in Great Yarmouth, North Norfolk and South Norfolk. Norwich was the only area in Norfolk which voted Remain.

https://infogr.am/238bf973-6551-4b5b-af27-9a1c3c355c23

The final poll released just hours before voting stations closed their doors put the Remain side ahead by a margin of 52pc to 48pc and Ukip leader Nigel Farage appeared to admit defeat on Thursday night.

But that turned to jubilation in the early hours of Friday morning as Leave scored one victory after the next in council areas across the UK.

Eastern Daily Press: vote counting takes place at St Andrew's Hall, Norwich after the ballot boxes arrived in a fleet of cars.PHOTO BY SIMON FINLAYvote counting takes place at St Andrew's Hall, Norwich after the ballot boxes arrived in a fleet of cars.PHOTO BY SIMON FINLAY (Image: ARCHANT NORFOLK)

London and Scotland where two of the few areas where people overwhelmingly backed Remain.

Prime Minister David Cameron had described the referendum as the most important vote in a lifetime and his future is now unclear.

Eastern Daily Press: Teddy, a 14-week old puppy waits outside the polling station at South Wootton Village Hall. Picture: Matthew Usher.Teddy, a 14-week old puppy waits outside the polling station at South Wootton Village Hall. Picture: Matthew Usher. (Image: © ARCHANT NORFOLK 2016)

A record number of voters were eligible to take part in the referendum, with the Electoral Commission putting the number at 46,499,537.

Turnout was high, despite torrential flooding in many parts of the country, including across Norfolk.

•For full reaction and analysis watch an EU special on Mustard TV News tonight, from 6pm.