By Nick Assinder
Political correspondent, BBC News website
Tony Blair won an unprecedented three elections in a row for Labour, served for a decade in Downing Street and is widely viewed in the Labour Party as the best leader it has had for a generation or more.
So exactly why is he quitting at this time, only two years after winning the 2005 election, three years before he has to call the next one and with the party as well set as most mid-term governments could hope?
Claims of a leadership deal between Mr Brown and Mr Blair disputed
To explain his exit you have to go back to a fateful dinner between Mr Blair and Gordon Brown at the Granita restaurant in Islington in 1994 in the wake of the death of party leader John Smith.
It was here that a deal was done which would see Mr Brown agreeing to stand aside so Mr Blair could run for the job, apparently after being persuaded that this would give Labour the best chance of winning over the crucial middle England swing voters and so end the then 15 years of Tory government.
The precise details of that deal have long been contested but it appears to have included a promise that Mr Brown would have unparalleled power over domestic policy as chancellor - and that Mr Blair would step down and hand over power at some future date.
'Fissure' at heart of government
Neither side has ever categorically stated their understanding of the terms of the deal, but there seems little doubt that Mr Brown later came to believe Mr Blair had reneged on it and was determined to remain as prime minister far longer than originally planned.
The personality clash that ensued constantly buffeted the government and no-one doubted the two were regularly at war as Mr Brown pressed for his chance to occupy 10 Downing Street.
As Peter Mandelson put it, there was a "fissure" at the heart of the Labour government over the past decade.
There were fears Mr Blair was to suffer the same fate as Margaret Thatcher
While in the public mind, especially at election time, the two have been seen as a harmonious partnership, ministers often found that they had two bosses to win over - the man at the treasury and the man at No 10.
One senior official likened it to being the child of bickering parents.
Against that background, it seems that the pressures and relationship difficulties grew as Blair approached the 10th anniversary of becoming Labour leader in 2004.
Mr Blair's standing as leader had suffered in the wake of the Iraq war - a decision he took against the wishes of many of his own party's MPs and his own party's members - and, it is believed, he was considering quitting.
He was persuaded to stay on by ministers loyal to him, ministers not known for their closeness to Mr Brown.
Talk of rebellion
Then in the summer of that year, when it was revealed he had a heart problem and had undergone an operation to correct it, he was engulfed by feverish speculation about his future intentions.
In what many believe was a fatal political mistake he attempted to kill the speculation about him quitting then, by announcing he would fight the looming 2005 general election, serve a full term and then step down to allow a successor to fight the fourth one.
It bought him time, but for many people he had made himself a lame duck leader and only ensured that, once the election was over, the pressure would switch to forcing a leaving date from him.
And, led by a group of so-called Brownite MPs, and despite the prime minister winning that election - albeit after relying heavily on Mr Brown and with a reduced share of the popular vote - that is exactly what happened.
Westminster became gripped by talk of a resignation date, backbench rebellions and attempts to force Mr Blair out of office. Few doubted much of this emanated from the Brown camp, either with or without Mr Brown's knowledge or encouragement.
It finally came to a head in the summer of 2006 when, despite the prime minister's repeated pledge he would serve a "full third term", he faced a coup to remove him.
The spark this time came when Mr Blair returned from his summer holiday and gave an interview in which he showed little sign of stepping down for two or three years.
The response was swift, a letter from junior ministers and MPs was delivered to Downing Street demanding his resignation, a couple of frontbenchers quit the government and the atmosphere in Westminster reached fever pitch with widespread speculation Mr Blair was about to suffer the same fate as Margaret Thatcher and be forced from office.
Mr Brown has the job he pursued for 13 years
Mr Brown had what was said to be an acrimonious meeting with the prime minister. Although he had denied being involved in the actions of his backers, during the meeting it appears he demanded a public announcement of an early resignation timetable.
Although the coup, if that was what it was, was called off and appeared to have failed, that early resignation date was exactly what Mr Brown and his supporters got.
In September 2006 during a visit to a school, the prime minister was forced to announce he would be standing down within a year declaring: "I would have preferred to do this in my own way."
So finally, 13 years after that disputed Granita deal which hung over three Labour administrations, Gordon Brown knew he was set to get the job he had long believed was his by right.
It was a view the Labour Party appeared to share and, despite concerted attempts by Blair loyalists to find one of their number to challenge him, he was given the job unopposed.
And the end result is that Tony Blair becomes an ex-prime minister at the relatively young age of 54, despite having won three large election victories and with opinion polls still suggesting the party was well set to head towards a fourth term in office.