Tony Blair has won a historic third term in government for Labour but with a drastically reduced majority.
Tony and Cherie Blair leaving Downing Street to see the Queen
Mr Blair pledged to respond "sensibly and wisely" to the result, which the BBC predicts will see his majority cut from 167 in 2001 to 66.
The Conservatives have mounted a strong challenge but their overall share of the vote will be similar to 2001.
The Lib Dems have made big inroads into Labour majorities and look set to end up with an estimated 60 seats.
Mr Blair, who celebrates his 52nd birthday on Friday, said it was clear that "the British people wanted to return a Labour government but with a reduced majority".
He told supporters at a celebration in the National Portrait Gallery in London: "We have got to listen to the people and respond wisely and sensibly."
Mr Blair and his wife Cherie left Downing Street at 1100 BST for a 30 minute audience with the Queen at Buckingham Palace - the private meeting where she asks him to form a new government.
Earlier, Mr Blair told party activists in his Sedgefield constituency that Labour, which looks set to have won 36% of the vote on a 61% turnout, had to "focus on the things that matter" such as the NHS, jobs and law and order.
He added: "I know too that Iraq has been a divisive issue in this country but I hope now that we can unite again and look to the future - there and here."
Majority between 60 and 70
About 36% of popular vote
Vote down 6% on 2001
The result writes a new chapter in British political history, with Margaret Thatcher the only other post-war prime minister to have won three successive general elections.
Mr Blair is the only Labour leader to have won three elections in a row but his margin of victory is less than half what it was in the Labour landslides of 1997 and 2001 - and he has the lowest share of the vote for a ruling party in modern times.
Conservative leader Michael Howard congratulated Mr Blair on Labour's win but said it was time for him to deliver on his promises.
"I am proud of the campaign we have fought. We have taken a stand on the things that really do matter to the people of this country. We have sent Mr Blair a message," said Mr Howard.
He added the Tories' result was a "significant step towards our recovery".
Provisional figures suggest 22% of those eligible to vote backed Labour - the lowest figure they have received at any post-war election apart from 1983 when the figure was 20.6%.
Turnout is up about 2% thanks to big increases in marginal seats.
Tories unseat Labour minister Stephen Twigg
George Galloway wins in Bethnal Green
Independent Richard Taylor wins again in Wyre Forest
Peter Law, who quit Labour in protest at all-women short-lists, overturns a 20,000 Labour majority to win Blaenau Gwent
The Conservatives did best in the South East, where they had a 2.3% increase in the share of the vote, and London, where they regained Putney and Wimbledon and unseated schools minister Stephen Twigg, who famously snatched Enfield Southgate from Michael Portillo in 1997.
The Tories also gained Shipley from Labour - unseating junior minister Christopher Leslie - Welwyn Hatfield from health minister Melanie Johnson, and Newbury from the Lib Dems.
The Lib Dems held on to Cheadle, which had been the Conservatives' top target, and unseated Labour ex-minister Barbara Roche on a 14% swing.
But they failed in their "decapitation" strategy to unseat ex-Tory chairman Theresa May and shadow home secretary David Davis and Oliver Letwin, who all retained their seats with increased majorities.
Only one member of the Tories' top team - education spokesman Tim Collins - was ousted.
Lib Dem leader Charles Kennedy said voters had ushered in a new era of three-party politics as he was returned as an MP by an overwhelming majority.
"I think it is going to be a very different House of Commons from the one we have had over the past eight years, and I think that is going to be very healthy, whatever people's political views," he added.
In one of the biggest upsets of the night, George Galloway, of the anti-war Respect party, narrowly beat Labour's Oona King, who voted for the Iraq war, in Bethnal Green, one of the most bitter contests in the 2005 election.
Mr Galloway, who based his campaign on opposition to the Gulf war, said: "This is for Iraq."
In a further sign of the impact of the Iraq war, there was a significant swing from Labour to Lib Dem in most of the 40 seats with a large Muslim population.
Mr Galloway's success means that there are more small party and Independent MPs than in any parliament since 1945, with wins for Richard Taylor in Wyre Forest and for Peter Law, who quit Labour in protest at all-women short-lists.
Turnout up slightly on 2001
Anti-war candidate Reg Keys polls 10% in Sedgefield
Alan Milburn quits frontline politics
Lib Dems win Manchester Withington on 17% swing from Labour
Lib Dems fail to unseat top Tories
BNP gains 5% of vote in seats where they stood
Robert Kilroy-Silk narrowly misses losing his deposit
BNP leader Nick Griffin took 9% of the vote in Keighley, where Labour's Anne Cryer was returned as the town's MP.
The Greens gained 22% of the vote in Brighton Pavilion, beating the Lib Dems into fourth place, but their vote was up just 0.4% nationally. UKIP's national share was up 0.8%.
Mr Blair is expected to put the finishing touches to a Cabinet reshuffle on Friday.
Treasury Chief Secretary Paul Boateng has stepped down to become Britain's High Commissioner to South Africa. Speculation is rife that former home secretary David Blunkett is destined for a comeback.
Ex-Cabinet minister Robin Cook, who quit over Iraq, said Mr Blair, who has said he will serve one more term, had to "consider very carefully to what extent he can leave Britain, the party and the nation guessing as to when exactly he might go".
In Scotland, Labour lost seats to the SNP, which reached their target of six seats, the Lib Dems and the Conservatives, who still have one MP in the country after winning Dumfriesshire, Clydesdale and Tweedale.
In Wales, the Lib Dems and Tories made gains, but Plaid Cymru failed to take its top target seat of Ynys Mon from Labour, and also lost Ceredigion.
Meanwhile, pro-hunting campaigner Otis Ferry, the son of rock star Bryan Ferry, was arrested as he tried to get to Mr Blair as the prime minister and his wife arrived at a post election party.
Mr Ferry lunged over a barrier at the rear entrance to the National Portrait Gallery in London and shouted in Mr Blair's face before a plain clothes police officer stepped in.
A fifteen year old was arrested for the attempted theft of a ballot box assaulting two polling staff in Middlesbrough.