The Conservatives have won the 2015 general election, with a majority of 12. Here's an at-a-glance guide to the key points of the election:
Parties grouped under 'others' include the DUP 8, Sinn Fein 4, SDLP 3, UUP 2 and Independent 1. Electoral turnout was 66.1%.
David Cameron has declared his intention to govern Britain for the next five years "in the interests of all its people". He has now started to form his new cabinet.
Labour leader Ed Miliband has resigned, saying it is "time for someone else" to take over the leadership and that he is "truly sorry" he did not succeed.
Deputy leader Harriet Harman also said she would stand down once a new leader and deputy leader were elected.
Lib Dem leader Nick Clegg has also resigned after the party suffered heavy losses, with their seats plunging from 57 to eight.
The SNP has won a landslide victory in Scotland, winning 56 seats. Scottish Labour leader Jim Murphy, Labour's Douglas Alexander, and Lib Dems Danny Alexander and Charles Kennedy all lost to the SNP.
Nigel Farage has resigned as UKIP leader after he failed in his bid to be elected in Thanet South.
Elsewhere on election night:
- Labour's shadow chancellor Ed Balls lost his Morley and Outwood seat to the Conservatives.
- Lib Dem Business Secretary Vince Cable and Education Minister David Laws lost their seats, as did fellow party stalwarts energy minister Ed Davey and Simon Hughes, the former deputy leader of the party
- George Galloway, Respect's only MP, was defeated in Bradford West
- Caroline Lucas held onto her Brighton Pavilion seat for the Green Party
- Employment minister Esther McVey lost to Labour in Wirral West
- Shadow Scottish secretary, Labour's Margaret Curran, lost in Glasgow East
- UKIP's Douglas Carswell won his Clacton seat, while the Conservatives defeated Mark Reckless in Rochester and Strood
- London Mayor Boris Johnson swept back into Parliament as Conservative MP for Uxbridge and South Ruislip
- Former director of public prosecutions Keir Starmer won for Labour the safe seat of Holborn and St Pancras
- Elections have been held for more than 9,000 council seats across England, with most of the counts taking place on Friday morning
What the parties said
- Conservative leader David Cameron: "We can make Britain a place where a good life is in reach for everyone who is willing to work and do the right thing. We will govern as a party of one nation, one United Kingdom."
- Labour leader Ed Miliband: "I take absolute and total responsibility for the result and our defeat at this election."
- Liberal Democrat leader Nick Clegg: "I always expected this election to be incredibly difficult. The results have been immeasurably more crushing than I could ever have feared."
- UKIP leader Nigel Farage called for "real, genuine, radical reform" of the voting system and said that on a personal level, he felt "like an enormous weight has been lifted from my shoulders"
- SNP leader Nicola Sturgeon: "There has been an overwhelming vote for change in Scotland and our 56 MPs will carry that message to the heart of Westminster."
- Green Party leader Natalie Bennett: "I am immensely proud to have led the party into a general election where we have been able to stand more Green candidates than ever before and saved a record number of deposits."
- Plaid Cymru leader Leanne Wood: "We have gained ground in new places such as the Rhondda, Cardiff, Pontypridd, Wrexham, and the western valleys, which will put us in good stead for the National Assembly elections next year."
BBC expert analysis:
Nick Robinson, political editor:"No pollster, no pundit, no political leader saw it coming - not even David Cameron himself. Governing parties don't gain seats. Parties that have implemented painful cuts and are promising more certainly don't. Until that is the Conservative Party did - achieving what had seemed to be Mission Impossible - a Tory majority."
BBC Scotland correspondent James Cook: "Is this the end of the union? That is the question many people will be asking after the party which has fought for Scottish independence for 80 years swept to victory. The answer from the jubilant Scottish National Party leader Nicola Sturgeon is a firm "no". She insists that her MPs will speak for all of Scotland, not just for the 45% who voted for the country to leave the United Kingdom last September. 'This changes nothing,'
Norman Smith, assistant political editor: "This has been an election which may have more profound consequences than almost any in living memory. "We now face a generational decision about our future in Europe, with an EU referendum in two years time almost certain. There will also be serious questions about the future of the Union, following an SNP landslide that has turned Scotland into a virtual one-party state. David Cameron's victory also represents a colossal achievement."
James Landale, deputy political editor: "After an extraordinary night, some brief conclusions: With a small majority or slight minority for David Cameron, Tory MPs will be much empowered. As such, Mr Cameron will need support from other parties to get business through. The PM will also need a better whips office to handle rebellions."
Laura Kuenssberg, chief correspondent, Newsnight: "For Labour the story of their terrible night is rapidly turning into the search for a new leader. So who will that be? Andy Burnham, the shadow health secretary, is almost certain to run. Even before this election, both he and another almost inevitable candidate, Chuka Umunna, had raised eyebrows inside the party at the work they had put in, preparing the ground with members and the unions for potential bids."
Robert Peston, economics editor: "Sterling is up (the most for seven years against the euro), share prices are up (especially bank shares like Lloyds and RBS, and energy shares such as Centrica), government bond prices are up. To state the obvious, investors love the Tories' general election victory. There are a few reasons."
Social media reaction
From Paddy Ashdown's hat to Alastair Campbell's kilt, what are people saying online?
It was a bad night for the pollsters. The BBC's David Cowling has been looking at how they got it so wrong.
Women in the Commons
The number of women in Parliament has risen by a third - the largest increase since 1997.
The latest pictures from the night are here: