David Cameron has vowed to govern for the whole of the United Kingdom as he returned to No 10 at the head of a majority Conservative government while the Scottish nationalists swept board north of the border.

After a stunning election night for the Tories, the prime minister paid generous tribute to his defeated rivals Ed Miliband and Nick Clegg who both announced that they would be quitting as leaders of their parties.

Following an audience with the Queen at Buckingham Palace to confirm his second term in office, Mr Cameron returned to Downing Street with a pledge to restore unity to the country after a bruising five week campaign.

Speaking on the steps of No 10, Mr Cameron - who had repeatedly warned of the dangers of a Labour government propped up by the votes of the SNP - said he would press ahead with the promised further devolution to Scotland "as fast as I can".

"As we conduct this vital work we must ensure that we bring our country together. We will govern as a party of one nation, one United Kingdom," he said.

"It means bringing together the different nations of our United Kingdom. I have always believed in governing with respect.

"In this parliament I will stay true to my word and implement as fast as I can the devolution that all parties agreed for Wales, Scotland and Northern Ireland."

The news that the Conservatives had passed the 326 mark needed for an outright commons majority came as Mr Cameron was at the palace for his audience with the Queen.

Earlier, addressing jubilant activists at Conservative Party headquarters, he hailed the result as the "sweetest victory of them all".

In what will go down as one of the biggest general election shocks since the Second World War, the Conservatives are projected to win 331 seats, with 232 for Labour, 56 for the SNP, eight for the Lib Dems and just one each for Ukip and the Greens.

Shadow chancellor Ed Balls and Business Secretary Vince Cable were among the big name casualties on a crushing night for Labour and the Liberal Democrats.

An emotional Mr Miliband apologised to supporters after seeing his hopes of entering No 10 shattered as Labour was blown away north of the border by the nationalists while struggling to take any seats from the Conservatives.

"I am truly sorry that I didn't succeed. I have done my best for five years. Now you need to show your responsibility. Your responsibility not simply to mourn our defeat, but to pick ourselves up and continue the fight," he said.

Mr Clegg, who also announced his resignation, said he believed history would judge his party's time in government "kindly" while issuing a stark warning of the potentially "disastrous" legacy of a highly divisive election campaign.

"This now brings our country to a very perilous point in our history where grievance and fear combine to drive our different communities apart," he said.

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

Ukip's Nigel Farage also announced he was quitting as leader of his party after failing to secure a Westminster seat in South Thanet - only to say that he could run again for the post in September.

While Mr Cameron was expected to announce the first appointments to his new Cabinet later today, the Labour and the Liberal Democrats face the prospect of lengthy and potentially bruising leadership contests.

Labour deputy leader Harriet Harman said that she would take up the reins as stand-in leader until a permanent successor was in place, at which point she would step down as deputy as well.