(Adds quote, odds)
By William James and Estelle Shirbon
LONDON, May 8 (Reuters) - British opposition leader Ed Miliband quit on Friday after his Labour Party suffered a heavy election defeat and was virtually driven out of Scotland, leaving the demoralised party with no obvious successor.
Miliband had gone into Thursday's election expecting he had a good chance of beating Prime Minister David Cameron's Conservatives and forming a government, probably in some form of alliance with a smaller party. Instead Cameron will govern again, this time with an overall parliamentary majority.
"Britain needs a Labour Party that can rebuild after this defeat so we can have a government that stands up for working people again," Miliband said at Labour's headquarters in London.
"And now it's time for someone else to take forward the leadership of this party, so I'm tendering my resignation," said Miliband, who will remain a Labour member of parliament.
Deputy leader Harriet Harman will take over until a new leader is elected, at which point she will in turn resign.
While Miliband's leadership style had often been criticised and his personal popularity ratings were well below Cameron's, some party figures suggested Labour's problems ran deeper.
"There is no point changing the captain on the bridge if the ship is heading in the wrong direction," said John Reid, who held several senior ministerial portfolios including defence and interior under former Prime Minister Tony Blair.
Labour suffered a mauling in Scotland, one of the party's historic heartlands, where it lost all but one of the 41 House of Commons seats it previously held there to the Scottish National Party.
In addition, Labour failed to capture swing seats in England from the Conservatives, who will now form a single-party government after five years in coalition with the Liberal Democrats.
Miliband said he took sole responsibility for the rout, in which some of Labour's most senior figures lost their seats.
Ed Balls, who would have been finance minister had Labour won, was defeated in his constituency. Campaign chief Douglas Alexander lost his seat in Scotland, as did Jim Murphy, head of Scottish Labour. Miliband's exit and Balls's defeat leave Labour shocked and rudderless.
WHAT NEXT FOR THE LEFT?
Possible leadership candidates could include Andy Burnham, who was health minister under former Prime Minister Gordon Brown, Yvette Cooper, who was work and pensions minister then, and Chuka Umunna, the party's spokesman on business since 2011.
It is also possible that a new leader could emerge from the ranks of relative newcomers with fewer links to either Brown or his predecessor Blair, such as members of parliament Dan Jarvis, Tristram Hunt, Liz Kendall or Rachel Reeves.
Betting firms were already offering odds, with Burnham and Umunna the front-runners and Cooper and Jarvis next in line.
Miliband himself was a surprise winner in Labour's 2010 leadership election, beating his older and better known brother David thanks to support from trade unions that earned him the nickname "Red Ed".
A sometimes awkward figure, Miliband was ridiculed as a geek by sections of the press and denounced as a weak leader by Cameron. Where the Conservative leader was seen as an asset to his party, Miliband was presented as a liability.
During the final weeks of the election campaign he was widely deemed to have outperformed expectations and his personal ratings had shown signs of improving, but the results on the night were a disaster.
Whoever replaces him will have to engage in soul-searching after Labour's near obliteration in Scotland, which raises questions about how the party can ever win a majority in the House of Commons again.
In the past, Labour usually won the lion's share of Scotland's 59 seats and relied on its Scottish members of parliament to make up the numbers necessary to form governments.
In England, Labour failed to gain significant ground from the Conservatives in the places where it mattered most, the swing seats, and lost some support to anti-European Union and anti-immigration party UKIP.
Blair, who won three elections in a row for Labour to be prime minister from 1997 to 2007, said before the election that if Labour presented itself as a traditional left-wing party opposing the right-wing Conservatives, it would lose as had happened in the past.
But Owen Jones, a left-wing author and Labour supporter, said veering to the right would be a bad knee-jerk reaction for Labour.
He said Miliband had failed to articulate a clear message or produce policies that would make a genuine difference to the lives of poorer Britons, the party's natural base.
"While the Tories (Conservatives) had clear messages, 'clearing up Labour's mess', balancing the books, reforming welfare and so on, Labour never build a coherent alternative," he wrote in the Guardian.
"There will be a big debate now over the future of the Labour Party, and what the left does next." (Additional reporting by Kate Holton, writing by Estelle Shirbon, editing by David Stamp and Giles Elgood)