Image copyright AFP

Voting is taking place in a historic referendum on whether the UK should remain a member of the European Union or leave.

A record 46,499,537 people are entitled to take part, according to provisional figures from the Electoral Commission.

Polling stations will close at 22:00 BST with counting throughout the night.

It is only the third nationwide referendum in UK history and comes after a four-month battle for votes between the Leave and Remain campaigns.

In common with other broadcasters, the BBC is limited in what it can report while polls are open but you can follow the results as they come in across the BBC after polls close on Thursday evening.

The referendum ballot paper asks the following question: "Should the United Kingdom remain a member of the European Union or leave the European Union?"

Whichever side gets more than half of all votes cast is considered to have won.

The weather forecast for polling day is mixed.

There have been thunderstorms in London and south-east England which caused flooding overnight.

Kingston upon Thames Council in south west London has moved two polling stations after they were inundated with water.

Image copyright AFP/Getty Image caption Prime Minister David Cameron cast his vote in London with wife Samantha

Image copyright Getty Images Image caption Labour leader Jeremy Corbyn voted in Islington

Image copyright Getty Images Image caption Scotland's First Minister Nicola Sturgeon cast her vote in Glasgow

Image copyright Getty Images Image caption Justice Secretary Michael Gove and wife Sarah Vine at a polling station in Kensington

Image copyright PA Image caption UKIP leader Nigel Farage at a polling station near Biggin Hill, Kent

Sunshine and heavy showers are forecast for Northern Ireland and Scotland but it is set to be drier and brighter elsewhere.

After the referendum polls close, sealed ballot boxes will be collected and transported to the count venue for each of the 382 local counting areas.

These represent all 380 local government areas in England, Scotland and Wales, plus one each for Northern Ireland and Gibraltar.

Follow the action on the BBC

Image caption Emily Maitlis, David Dimbleby and Jeremy Vine will host BBC One's coverage

From 22:00 BST, there will be comprehensive coverage on the BBC News website and app with live text and video streaming, reaction and analysis from BBC editors and others. There will also be an up-to-the-minute full results service and details of all local results.

BBC One, the BBC News Channel and BBC Parliament will broadcast a results show hosted by David Dimbleby alongside BBC experts and special guests from 21:55 BST. Coverage continues through the night and Sophie Raworth, Andrew Neil and Victoria Derbyshire pick up the coverage on Friday morning.

The results programme will be streamed internationally on the BBC News website from 22:00 BST.

BBC Radio 5 live will have coverage as the results come in, as will Radio 4 from 23:00 BST until the Today programme picks up at 06:00 BST on Friday.

From 22:00 GMT, television viewers outside the UK can tune in via BBC World News and BBC World News America. Listeners outside the UK can tune into BBC World Service radio for regular updates.

Referendum night - what to watch out for

Results from these areas will then be declared throughout the night, along with result totals from 11 nations and regions.

Depending on how close the poll is, the result may become clear before the final national result is officially declared by the Chief Counting Officer, who will be based at Manchester Town Hall.

Image copyright PA Image caption Polling stations are open until 22:00 BST

Image copyright AFP/Getty Image caption Voting is taking place in a range of buildings, including this pub near Tunbridge Wells

Image copyright PA Image caption There was heavy rain in some parts of the country including Newham, east London

The Electoral Commission estimates a final result "around breakfast time" on Friday.

The last nationwide referendum took place five years ago, when voters rejected an attempt to change the way MPs are elected.

The first one was in 1975, when the country was asked whether the UK should continue to be a member of what was then called the European Economic Community.