PM Gordon Brown presents his resignation to the Queen

British Prime Minister Gordon Brown has tendered his resignation to Queen Elizabeth II after announcing he was stepping down to allow a new government to be formed to resolve last week's general election stalemate.

AFP - British Prime Minister Gordon Brown resigned Tuesday, ending 13 years of Labour rule and paving the way for Conservative leader David Cameron to take power five days after deadlocked polls.

The announcement came as the Conservatives, who came top in the polls, appeared to be finalising a power-sharing deal with the third-placed Liberal Democrats.

"I've informed the Queen's private secretary that it is my intention to tender my resignation to the Queen," Brown said in a statement in Downing Street, his voice cracking with emotion.

"In the event that the Queen accepts I shall advise her to invite the leader of the opposition to seek to form a government. I wish the next prime minister well as he makes the important choices for the future."

Immediately afterwards, he and his wife Sarah were driven from Downing Street to Buckingham Palace for Brown offer his resignation to Queen Elizabeth II, Britain's head of state.

He spent 15 minutes at the palace before emerging without the police outriders reserved for prime ministerial convoys.

A statement issued by Buckingham Palace afterward said the queen had accepted his resignation.

A look back at Gordon Brown's political career

In last Thursday's general election, the Conservatives won 306 seats in the 650-member House of Commons -- 20 short of a clear majority of 326 -- followed by Labour on 258 and the Lib Dems on 57.

After five days of talks between the Lib Dems and Tories -- and briefly between Nick Clegg's Lib Dems and Labour -- there was no immediate announcement of a deal between Cameron's and Clegg's parties.

But several Labour lawmakers effectively conceded to Cameron and the BBC cited a senior Lib Dem official as saying the power-sharing offer from David Cameron's Conservatives was now "the only deal in town."

The party declined to comment formally. Tory and Liberal Democrat negotiators emerged after hours of talks late Tuesday and said they were now going to consult their parties.

Brown wished Cameron well as he departed from top-level politics, while acknowledging the personal weaknesses -- such as poor presentational skills and impatience -- which have hampered his three-year premiership.

"Only those who have held the office of prime minister can understand the full weight of its responsibilities and its great capacity for good," Brown said.

"I have been privileged to learn much about the very best in human nature and a fair amount too about its frailties -- including my own."

Brown then walked down Downing Street holding hands with his wife Sarah and their two young sons John and Fraser, who were making an extremely rare public appearance.

Brown has spoken to his predecessor Tony Blair by phone and is now set to resign as a lawmaker and leave politics, media reports said.

In the hours before he quit, Brown faced increasing signs that hopes for a Labour deal with the Lib Dems had faded and that his job was coming to a rapid end.

He had said he would resign as Labour leader Monday but could have stayed on for several months as a caretaker had Labour struck a deal with fellow leftist the Lib Dems.

Health Secretary Andy Burnham indicated that he agreed with senior former Cabinet minister David Blunkett, who has said that Labour should admit defeat and not try to form a coalition with the Lib Dems.

"I think we have got to respect the result of the general election and you cannot get away from the fact that Labour didn't win," he told the BBC.

And senior Labour MP Stuart Bell said: "May I be the first to congratulate David Cameron, he's fought a fine campaign... we wish him well in all the tasks he has to do."

Earlier Tuesday, Cameron had piled pressure on Clegg's party to decide which way to jump after he offered Monday a referendum on their touchstone issue of electoral reform.

"It's now I believe decision time, decision time for the Liberal Democrats," said Cameron, adding: "I hope they make the right decision that will give this country the strong, stable government it badly needs and badly needs quickly."

Labour and the Lib Dems are ideologically closer, on the left of the political spectrum, than the centre-right Conservatives and the Lib Dems, although the electoral arithmetic of a Tory/Lib Dem deal is stronger.