Election 2015: Analysis from BBC correspondents
The political future of the United Kingdom has become clearer after the results of the general election emerged around the country.
David Cameron says he hopes to govern for all of the UK after the Conservatives took 331 seats - enough to form a slender majority in the Commons.
Labour has been all but wiped out by the SNP in Scotland and suffered a disappointing set of results elsewhere, while the Lib Dems are left with just eight MPs after many party heavyweights such as Vince Cable and Danny Alexander lost their seats.
So with battles won and lost and the fall-out and celebrations beginning, BBC correspondents examine the implications and challenges that lie ahead for the new government - and for those whose political careers have been ended by voters.
Nick Robinson, BBC 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.
Until that is David Cameron's personal triumph which triggered the near simultaneous resignation of his three principle opponents - Messrs Miliband, Clegg and Farage.
They did so in part because they helped to crush their partners in coalition these last five years - reducing the Liberal Democrat parliamentary party to a size when it can fit into two London taxis and still have two seats to spare.
In part because the extraordinary tidal wave of support for the SNP swept dozens of once safe Labour seats away.
In part because Nigel Farage persuaded millions to vote for him but secured just one seat - not, though, the one he was standing in.
Mark Easton, BBC home editor
The question uppermost in the prime minister's mind as he assembles his new government is how to keep the kingdom united.
"Above all I want to bring our country together," he revealed after the result, "to reclaim a mantle we should never have lost - the mantle of one nation, one United Kingdom".
Looking at the political landscape from Land's End today is very different to the view from John O'Groats.
A sea of Conservative and Unionist blue dominates the scene across much of England, while a field of SNP nationalist yellow stretches to the horizon and beyond from the north.
David Cameron's greatest challenge is to prevent the union he supports being torn apart by mutual resentment - resentment from Scotland at a Westminster government dominated by English Tories, and resentment from England at the preferential treatment people think is being given to the Scots.
Those who assumed the future of the Union had been safeguarded by the Scottish referendum must think again.
Jonny Dymond, BBC campaign correspondent
One thing is rock-solid true: the Conservatives who worked on this campaign are as surprised by the result as the pollsters, pundits, politicians and general population.
Maybe they shouldn't be - the economy is in good shape and the Conservatives had incumbency advantage.
But when I travelled back from the prime minister's last rally with a group of exhausted Conservative campaign officials it was clear that 290 seats was a hoped-for target.
No-one talked about anything over 300 seats, and no-one even mentioned an overall majority.
So what special sauce pushed David Cameron into No 10 with a Commons majority?
Mr Cameron had two simple messages in the campaign and he rarely veered away from them; the first - the economy is in good shape and the recovery is threatened by Labour. And the second - the SNP would hold a Labour-led government to ransom.
Brian Taylor, BBC political editor, Scotland
Of all the comments on the overnight apocalypse, undoubtedly the most straightforward came from a defeated Scottish Labour MP.
Since there were quite a few of them, let me narrow the focus a little. Come on down, Tom Harris.
Mr Harris had plainly anticipated defeat. Nonetheless, he looked suitably lugubrious as his fate was confirmed.
Why, he was asked eagerly, had Labour lost? "Because we did not win enough votes."
Psephologically, it is perfect. Complete in itself. Psychologically, it sums up Labour's gloom without descending into subsidiary matters such as leadership, strategy and the rest. As a forward-thinking strategy, it is ideal. Win more votes. Simple.
Norman Smith, BBC 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.
Only once before in recent history has an incumbent government increased its majority - and that was Mrs Thatcher in her prime in the 1980s.
It is also a significant personal victory for Mr Cameron and a rebuff for those in his party who had become increasingly sceptical about his ability to win.
But while it may represent a defeat for those Tories who saw this election as a potential opportunity to rid themselves of David Cameron, he must now govern with a wafer-thin majority.
For the SNP, their stunning victory can only increase the pressure on Nicola Sturgeon to include a commitment to a second independence referendum in her party's manifesto for next year's Scottish elections.
It is an election which has not just defied all the predictions of the pollsters and pundits - but which may yet prompt the most fundamental re-casting of British politics for a generation.
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.
- The arrival of 56 SNP MPs will transform the House of Commons and British politics.
- Labour and the Lib Dems will need new leaders.
James Cook, Scotland correspondent
Is this the end of the union?
That is the question many people will be asking this morning 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.
In the closing hours of the most extraordinary election campaign which anyone in Scotland can remember, Ms Sturgeon turned to talk of "legitimacy."
That will be her watchword in the coming days as she argues that the prime minister cannot ignore the democratic will of the Scottish people.
Politically, Scotland and England this morning look and feel like very different countries.
Chris Mason, political correspondent
After weeks of chatter about an election too close to call, it wasn't that close at all.
David Cameron will be continuing as our prime minister.
So, what is all this likely to mean?
A referendum on whether the UK stays in, or leaves, the European Union, within the next two-and-a-half years.
A race to be the next leader of the Labour Party.
A race to be the next leader of the Liberal Democrats.
And a huge new presence of Scottish National Party MPs at Westminster.
And so here's another thing we know for certain this morning: Politics ain't going to be boring any time soon.
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.
Yvette Cooper, before the election, was still thought not to have made up her mind over whether to run. That decision has been made perhaps a little easier as her husband, Ed Balls, has lost his seat.
She is certainly potentially in the frame, along with two lesser known names - Liz Kendall and Dan Jarvis - two MPs who were only elected in 2010 for the first time.
This could be their moment. But whoever is in the job, they face a monumental task.
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.
One (no surprise here) is that Labour's threat of breaking up banks and imposing energy price caps has been lifted.
Second is that investors have been discounting days and weeks of wrangling after polling day over who would form the government - and so they are semi-euphoric that we already know who's in charge.
Third, many investors tend to be economically conservative and instinctively Conservative.
But although the City may be a bit drunk on the result, its pleasure in Ed Miliband's and Ed Balls' humiliation may be making it a bit blind - perhaps dangerously so - to some bumps in the economic road ahead.
Robin Brant, political correspondent
Nigel Farage dreamed of holding the balance of power, but in the end his UKIP party is now worse off than when it came into the election.
At the seventh time of asking he was rejected - this time by the people of Thanet South. It was a similar story in Rochester and Strood where Mark Reckless, who sensationally defected from the Tories last year, was also sent packing.
In seats on UKIP's target list, like Thurrock in Essex, the party failed to make gains. In Grimsby - where Mr Farage went twice in the last six weeks - they came third.
UKIP got around four million votes - with especially strong showings in north-east and south-east England - but it's ended up with just one MP, and a vacancy at the top. This has led to UKIP attacking the current system of choosing MPs, which it's described as "busted" and "dysfunctional".
In one sense, this campaign was a complete failure and it's left an aftermath of angry voters, and others wondering if the UKIP bubble has burst.
David Cowling, editor, BBC Political Research Unit
I monitored 91 GB-wide voting intention polls during the 2015 election campaign and found nothing in them to prepare me for the final outcome.
The good news for the pollsters was that their share for the Lib Dems was pretty close, as were the shares for UKIP, the Greens and the catch-all category of Others.
The bad news for the polling industry was that the crucial shares for Conservative and Labour were the ones where they came most adrift.
When all the qualifications of margins of error are allowed, there did appear to be a systematic overstatement of the Labour share and an equally systematic understatement of the Conservative one.
It is for the pollsters to decide whether to conduct a review of their performance but I trust they will avoid the initial knee-jerk reaction of the immediate aftermath of the 1992 polls debacle.
This general election performance follows the performance of the polls in the 2014 Scottish referendum where the choice was simply binary and yet all the polls were out by between 4-6%.
Something is wrong. A lot of us would like to know what it is.
Katya Adler, Europe editor
The words "political earthquake" have been translated into numerous European languages, making front page news across the continent.
While Britons now examine the domestic minutiae of the election result, here in mainland Europe the vote means one thing: a referendum on Britain's membership of the EU. And that has the potential to create an earthquake of its own.
The guardian of the EU treaties Mr Cameron wants to change - Commission President Jean-Claude Juncker - has said again he'd listen to what Britain's new government proposed.