Tony Blair has announced he will stand down as prime minister on 27 June.
He made the announcement in a speech to party activists in his Sedgefield constituency, after earlier briefing the Cabinet on his plans.
He acknowledged his government had not always lived up to high expectations but said he had been very lucky to lead "the greatest nation on earth".
He will stay on in Downing Street until the Labour Party elects a new leader - widely expected to be Gordon Brown.
In an emotional speech, Mr Blair said he had been prime minister for 10 years which was "long enough" for the country and himself.
He said expectations had probably been "too high" in 1997, but he insisted living standards had improved under Labour.
"There is only one government since 1945 that can say all of the following: more jobs, fewer unemployed, better health and education results, lower crime and economic growth in every quarter. Only one government, this one."
It was for others to judge whether he had made mistakes, added Mr Blair, but he said he had always done what he thought was "right".
"I may have been wrong. That's your call.
"But believe one thing if nothing else, I did what I thought was right for our country. And I came into office with high hopes for Britain's future, and, you know, I leave it with even higher hopes for Britain's future."
In conclusion, he said: "Actually I've been lucky and very blessed. And this country is a blessed nation.
"The British are special - the world knows it, in our innermost thoughts we know it. This is the greatest nation on earth."
Deputy prime minister John Prescott is expected to announce he is standing down at a meeting of his local Labour Party in Hull later.
Earlier, Gordon Brown paid tribute to Mr Blair's leadership, praising "his unique achievement over 10 years and the unique leadership he had given to the party, Britain and the world".
His comments were greeted by "much thumping of tables" by the Cabinet colleagues, the prime minister's official spokesman told reporters.
Northern Ireland Secretary Peter Hain said it had been a "cordial, comradely" meeting with "quite a lot of laughter" and "leg-pulling".
Mr Hain, who is a candidate for Labour's deputy leadership, said Mr Brown would now "take up Tony Blair's mantle in the next period of our government".
Mr Blair's election agent and close friend John Burton said he expected Mr Blair to continue as Sedgefield's MP until the next general election, unless he was offered a major international job.
Former Cabinet minister and Blair ally Alan Milburn said thought the prime minister "slightly regretted pre-announcing his retirement" by saying he would not seek a fourth term.
"I think he would have preferred to stay longer," added Mr Milburn but he said the prime minister had had "a good 10 years" and had "fundamentally changed the country for the better".
Mr Blair's official spokesman insists he will remain "focused" on being prime minister until Labour has chosen his successor - a process expected to last seven weeks.
He said Mr Blair still has lots of work to do on domestic issues and had a number of international commitments in the run-up to this summer's G8 and EU summits.
But with a new prime minister expected to be in place by the beginning of July, attention at Westminster has already shifted to his succession.
Mr Brown is unlikely to face a Cabinet-level challenge for the leadership as all of the likely contenders have ruled themselves out.
But he could still face a challenge from one of two left wing backbenchers - John McDonnell and Michael Meacher. The pair are meeting later to see if one of them can muster enough support to get on to the ballot paper.
Candidates need the signatures of 45 Labour MPs to enter a contest.
Six deputy leadership hopefuls will also be battling for nominations to enter the race to replace John Prescott, who is due to stand down with Mr Blair.
Conservative leader David Cameron has said the country faces seven weeks of "paralysis" until Labour chooses a new leader, accusing Mr Blair of running a government of the "living dead".
The Liberal Democrats have, meanwhile, tabled a Parliamentary motion urging the Queen to dissolve parliament and call a general election.
But European Union Trade Commissioner and close Blair ally, Peter Mandelson, denied that Mr Blair's last weeks in office would be as a lame duck leader.
"'He's going of his own choice. He's doing it at a time which he thinks is good for the country, is good for the government."