Nick Clegg has dramatically quit as Liberal Democrat leader after seeing his party annihilated at the polls as David Cameron claimed the scalps of three of his rival party leaders.

As his erstwhile coalition partner prepared to head to Buckingham Palace to confirm his second term as Prime Minister, at the head of a majority Conservative government, Mr Clegg said the Lib Dems had suffered a "catastrophic" defeat in the General Election.

"Clearly the results have been immeasurably more crushing and unkind than I could ever have feared. For that I must take responsibility and therefore I announce that I will be resigning as leader of the Liberal Democrats."

His departure is expected to be followed in short order by Ed Miliband, who saw his dream of gaining No 10 shattered on a devastating night for Labour with shadow chancellor Ed Balls heading a list of high-profile casualties.

The Labour leader wrote on his Twitter account: "The responsibility for the result is mine alone."

It was a bitter night also for Nigel Farage, who announced he was quitting as Ukip leader after failing in his bid to secure a Westminster seat in South Thanet - although he said he would consider standing for the post again in September.

Mr Clegg's resignation became inevitable after the Lib Dems' tally of MPs was reduced from 56 to a rump of just eight, with Business Secretary Vince Cable, Treasury Chief Secretary Danny Alexander, and Energy Secretary Ed Davey among the fallers.

His announcement followed a dramatic night which saw the Scottish National Party sweep away Labour in its strongholds north of the border.

While Mr Clegg acknowledged that the Lib Dems had paid the price for five years in coalition with the Tories, he said the history books would judge their time in government "kindly".

And he warned that the UK was at a "very perilous point" where the politics of grievance and fear risked driving the country apart.

"It is no exaggeration to say that, in the absence of strong and statesmanlike leadership, Britain's place in Europe and the world and the continued existence of our United Kingdom itself is now in grave jeopardy," he said.

In a night that will go down as one of the biggest General Election shocks since the Second World War, the Tories claimed the biggest scalp as shadow chancellor Ed Balls was defeated by a margin of 422.

Returning to Conservative headquarters, Mr Cameron told jubilant activists the election result was the "sweetest victory of them all".

In his acceptance speech following his re-election as MP for Witney, Mr Cameron set out his intention to press ahead with an in/out referendum on Britain's membership of the European Union and to build on the economic foundations laid by the Coalition since 2010.

"My aim remains simple - to govern on the basis of governing for everyone in our United Kingdom," he said.

He made clear that he was determined not to allow the rising tide of nationalism to lead to the break-up of the UK, saying: "I want to bring our country together, our United Kingdom together, not least by implementing as fast as we can the devolution that we rightly promised and came together with other parties to agree both for Wales and for Scotland.

"In short, I want my party, and I hope a Government I would like to lead, to reclaim a mantle that we should never have lost - the mantle of One Nation, One United Kingdom. That is how I will govern if I am fortunate enough to form a Government in the coming days."

The Prime Minister smiled and waved as he entered No 10 with his wife Samantha, but made no comment to waiting reporters.

Downing Street said he would drive to Buckingham Palace at 12.30 ahead of his attendance at a ceremony at the Cenotaph to mark the 70th anniversary of VE Day.

With the Tories far outperforming expectations in an election which had been forecast to be a neck-and-neck race, Mr Cameron may be able to govern without coalition partners, either at the head of a minority administration or with a wafer-thin overall majority.

The scene was set for a difficult few years for the Prime Minister, who will be acutely vulnerable to rebellions by 30-40 Conservative backbenchers, who have already shown themselves ready to defy him on issues such as Europe and the family.

A clearly crestfallen Mr Miliband described the election as "very disappointing and difficult" for Labour and said "the next government" would have a huge responsibility to hold the United Kingdom together.

Mr Miliband made no comment about his own position as he left for Westminster, though senior figures including veteran former minister Jack Straw said he would have to "make up his mind about his future" as party leader.

As the SNP swept up one Labour stronghold after another - toppling the party's Scottish leader Jim Murphy and shadow foreign secretary Douglas Alexander and snatching the former constituency of ex-prime minister Mr Brown - the party's former leader Alex Salmond said there had been an "electoral tsunami" north of the border.

Mr Salmond, who returned to Parliament as MP for Gordon, said: ''There's going to be a lion roaring tonight, a Scottish lion, and it's going to roar with a voice that no government of whatever political complexion is going to be able to ignore."

But the party was denied the clean sweep some had predicted north of the border, as the Liberal Democrats held Orkney and Shetland, Ian Murray held on to Edinburgh South for Labour, and David Mundell remained the only Tory MP in Scotland, holding on to Dumfriesshire, Clydesdale and Tweeddale.

Conceding his own defeat in Morley and Outwood, Mr Balls - who might otherwise have been a contender to replace Mr Miliband - said: "Any personal disappointment I have at this result is as nothing compared to the sense of sorrow I have at the result Labour has achieved across the UK, and the sense of concern I have about the future."

Mr Balls predicted five years of public spending cuts and threats to the NHS, as well as questions about Britain's position in Europe and the future of the Union.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.