Image copyright Getty Images Image caption A man goes to vote at Groomsport boathouse in Belfast

Millions of people have been casting their ballots across the UK as voting enters its final half-hour.

Polls close at 22:00 BST with results from the first constituencies expected before midnight and the final result due on Friday afternoon.

After six weeks of campaigning and debate, people have been casting their vote at around 50,000 polling stations.

There are also more than 9,000 council seats being contested across 279 English local authorities.

Mayors will also be elected in Bedford, Copeland, Leicester, Mansfield, Middlesbrough and Torbay.

During Thursday morning political leaders visited their local polling stations.

UKIP leader Nigel Farage, Labour leader Ed Miliband, Greens leader Natalie Bennett, SNP leader Nicola Sturgeon, Conservative leader David Cameron, Liberal Democrat leader Nick Clegg and Plaid Cymru's Leanne Wood all cast their votes.

In Northern Ireland DUP leader Peter Robinson and Sinn Fein's Martin McGuinness in Northern Ireland have voted, as have SDLP leader Alasdair McDonnell, Alliance Party leader David Ford and Ulster Unionist leader Mike Nesbitt.

Media playback is unsupported on your device Media caption Throughout the morning, the main party leaders cast their vote in the general election

A total of 650 Westminster MPs will be elected, with about 46.5 million people registered to vote.

The weather has been dry and mild across much of the UK, with isolated showers in some parts of the north of England.

The local votes taking place mean that nearly every voter in England - excluding London where there are no local elections - will have been given at least two ballot papers when they enter polling stations.

Some votes had been cast before Thursday through postal voting, which accounted for 15% of the total electorate at the 2010 general election, when the overall turnout was 65%.

For the first time, people have been able to register to vote online.

Image copyright EPA Image caption Conservative leader David Cameron and his wife Samantha voted in the village of Spelsbury in Oxfordshire

Image copyright AP Image caption Labour Party leader Ed Miliband and his wife Justine walk to the polling station at Sutton Village Hall in Doncaster

Image copyright EPA Image caption Liberal Democrat leader Nick Clegg and his wife Miriam Gonzalez Durantez outside a polling station in Sheffield

Image copyright AP Image caption UKIP leader Nigel Farage cast his vote at a polling station in Ramsgate in Kent

Image copyright PA Image caption SNP leader Nicola Sturgeon voted with her husband Peter Murrell, at Broomhouse Community Hall in Glasgow

Image copyright Reuters Image caption Natalie Bennett, leader of the Green Party, leaves a polling station in London

Image copyright PA Image caption Plaid Cymru leader Leanne Wood arrives to vote at a polling station in Penygraig in Rhondda

Most polling stations are in schools, community centres and parish halls, but pubs, a launderette and a school bus are also being used.

Coverage

Polls close at 22:00 BST, but officials say anyone in a polling station queue at this time should be able to cast their vote.

The BBC's main election programme, fronted by David Dimbleby, starts at 21:55 BST, with live coverage from 220 counts.

Wales, Scotland and Northern Ireland will have their own overnight programmes but will join Huw Edwards from 07:00 BST on 8 May.

On the radio, a joint overnight broadcast by BBC Radio 4 and 5 live will be hosted by Jim Naughtie and Carolyn Quinn.

Full coverage of the results as they come in will be on the BBC politics online live page and front page scorecard, with all the big breaking stories from around the country and analysis by correspondents.

Correction 8 May 2015: This article has been updated to correct the figure for registered voters from 50 million to 46.5 million.