David Cameron has become the UK's youngest Prime Minister in almost 200 years as the head of a Conservative-Liberal Democrat coalition which was agreed during a day of extraordinary drama in Westminster.
The new coalition is Britain's first since the Second World War. Mr Cameron's 23-strong Cabinet will include five Liberal Democrats, giving the party their first taste of real power for 70 years. Nick Clegg, their leader, becomes Deputy Prime Minister.
The Tory leader was formally appointed by the Queen just minutes after Gordon Brown met her to tender his resignation, following the collapse of Labour's talks with the Liberal Democrats aimed at keeping the Conservatives out of power.
The 43-year-old Mr Cameron is the youngest Prime Minister since Lord Liverpool in 1812. He is six months younger than Tony Blair was in 1997. After a long, five-day wait since last Thursday's election, Mr Cameron finally went to Buckingham Palace last night when Mr Brown brought down the curtain on New Labour's 13 years in power.
As the first Cabinet appointments emerged, George Osborne became Chancellor; William Hague was confirmed as Foreign Secretary, Andrew Lansley as Health Secretary and Liam Fox as Defence Secretary. For the Liberal Democrats, Mr Cable is expected to become Chief Treasury Secretary, David Laws the Schools Secretary and Danny Alexander the Schools Secretary. The Liberal Democrats are likely to have at least one minister in each Whitehall department, giving them about 20 posts. Their appointments will leave some Tory MPs who were frontbench spokesmen in opposition out in the cold.
Speaking outside No 10, Mr Cameron said that a "proper and full coalition" between the Tories and Liberal Democrats would bring "the strong, stable, good and decent government we need so badly". He admitted it would be "hard and difficult work" and that the coalition deal would "throw up all sorts of challenges". He said it would be built on the values of "fairness and responsibility".
After paying a generous tribute to Mr Brown's "dedicated public service", Mr Cameron said: "Nick Clegg and I are both political leaders who want to put aside party differences and work hard for the common good and for the national interest. I believe that is the best way to get the strong government that we need, decisive government that we need today."
The deal hammered out between the Tories and Liberal Democrats, formally put to MPs in both parties late last night after Mr Cameron took office, includes progress towards the Liberal Democrats' flagship proposal to raise tax thresholds to £10,000. Some of the money will be found by not stopping Labour's planned rise in national insurance contributions for employees next April, although it will be halted for employers. The Tories will shelve their plans to cut inheritance tax.
But the Tories insisted on £6bn of public spending cuts going ahead this year, even though they were opposed by the Liberal Democrats during the election campaign.
They also agreed to five-year parliaments, a key Liberal Democrat demand under which Mr Cameron would surrender a prime minister's power to choose the date of a general election. This means the next election is due to be held on the third Thursday in May 2015 and reduces Mr Cameron's chances of calling a snap poll at a time to maximise the Tories' prospects.
The Liberal Democrats won a referendum on bringing in the alternative vote system for Commons elections and the House of Lords will be transformed into a mainly elected chamber. Tory plans for welfare reform, new independent state schools and a cap on the number of immigrants from outside the European Union will go ahead. Identity cards and child detention will be scrapped.
The two parties agreed to disagree over Britain's Trident nuclear missile system; nuclear power and Tory plans to reward marriage in the tax system. They agreed not to join the euro or transfer more powers to the EU. An independent commission on splitting the banks' investment and retail operations will report within a year.
Shortly after he arrived in Downing Street Mr Cameron took a phone call from President Barack Obama and later received a call from Germany's Chancellor Angela Merkel.
In a break with protocol, an impatient Mr Brown jumped the gun, taking Mr Cameron by surprise by travelling to the Palace to tender his resignation while formal talks between the Tories and Liberal Democrats on a coalition deal were still continuing after several hours. But it was clear by then that the Tories were closing in on an agreement with Mr Clegg's party and there was no prospect of forging a "progressive alliance" between Labour and the Liberal Democrats, as Mr Brown hoped when he announced on Monday that he would quit as Prime Minister by September. The Liberal Democrats accused Labour of never taking an agreement with them seriously. A spokesman said: "Key members of Labour's negotiating team gave every impression of wanting the process to fail and Labour made no attempt at all to agree a common approach with the Liberal Democrats on issues such as fairer schools funding for the most deprived pupils and taking those on low incomes out of tax."
He added: "It is clear that some people in the Labour party see opposition as a more attractive alternative to the challenges of creating a progressive, reforming government, not least in the context of a Labour leadership election campaign." But senior Labour figures accused Mr Clegg of intending to do a deal with the Tories all along. They claimed he was "covering his back" by opening separate coalition talks with Labour on Monday after several of his MPs made clear they would prefer an agreement with Labour to one with Mr Cameron.
Labour sources claimed the Liberal Democrat negotiating team came to the talks with a £27bn shopping list of policy demands – including the introduction of the alternative vote in Commons elections without a referendum; raising the income tax threshold to £10,000 at a cost of £17bn; a ban on new nuclear power plants; raising the target for the share of energy from renewable sources from 15 to 40 per cent; a £2.5bn "pupil premium" to boost schools spending in poorer areas and the abolition of identity cards. It is believed that Labour was prepared to delay legislation on a third runway at Heathrow Airport.
Lord Mandelson, who led Labour's team, insisted his party had been "up" for a deal with the Liberal Democrats. "In the final analysis, I am wondering whether that is what they actually intended." Accusing them of putting up barriers and obstacles, he believed their instincts lay "on the Conservative side rather than the progressive side".
Ed Balls, the outgoing Schools Secretary, who was on Labour's negotiating team, said last night that the Liberal Democrats wanted faster action on spending cuts. "There were problems on policy. Fundamentally, it became clear that the Liberal Democrats had chosen the Conservatives."