Brown is leaving with dignity after a dogged campaign to save Labour from eclipse, writes Donald Macintyre.
Exactly two weeks ago Gordon Brown was unexpectedly asked by a cheerful female Asda employee during a question-and-answer session at the company's store in Weymouth what was the oddest thing he had done for charity.
The question came at a time when the relentlessly criticised failures of the election were weighing heavily upon him.
But a surprised Brown laughed gamely, and then there was a tiny pause, so agonising for all in the room that his wife Sarah gallantly opened her mouth to answer for him.
In fact, there was no cause for worry. Cutting through his wife's words, he answered fluently that it was when, for light relief, "I counted every penny of the day's takings when I was Chancellor of the Exchequer", before going on - amid spontaneous and relieved laughter - to ask the woman the same question and to praise with evident sincerity all those who volunteered and collected for charity.
The tiny incident - "nice Gordon" at his best - goes some way to illustrate the paradoxical nature of this most complicated of British post-war politicians.
Often warm and witty in private, capable of touches of grace (such as when he telephoned Lord Peter Mandelson to offer condolences on his mother's death at the peak of one of their poisonous feuds), intellectually curious and literate, he could also be calculating, rivalrous, single-mindedly ambitious and witheringly aggressive to those perceived, not always rightly, as his opponents.
He was a man capable of unleashing, in the words of his Chancellor Alistair Darling, long one of his staunchest allies, "the forces of hell" at those who incurred his disapproval.
It is a testament to the force and timing of yesterday's announcement that the memory of his many "psychological flaws" - a term almost certainly attributable to Tony Blair's press secretary Alastair Campbell - will be counterbalanced by the service he has now performed for his party.
It will also reinforce his deserved status as a big figure, undoubtedly a member of the post-war Premier League of politicians.
The campaign he fought - including in the televised debates - did in fact keep Labour in second place, removing fears that his party might be superseded by the Liberal Democrats.
And provided Labour does not now tear itself apart, his resignation yesterday bequeaths the party the opportunity to start afresh and build a leadership of the next generation which can re-establish it as the main - and still potentially formidable - challenger to British Conservatism.
Brown is leaving with dignity, having fought a gallant campaign to save Labour from eclipse. And as is its way, the party is going to feel exponentially better about him now.
That Brown did much of the heavy lifting - particularly on economic policy - in order to propel New Labour into power is not in doubt. His role as the architect of the parliamentary defeat of John Major over VAT on fuel did much to weaken the credibility of the Tory Government.
It was not merely that he invented the phrase "tough on crime, tough on the causes of crime" that did so much, in the wake of the James Bulger murder, to establish Tony Blair, his friend and Shadow home secretary, as a future party leader.
It was that he - unlike Blair - paid a substantial personal price for resisting with unflinching determination as Shadow chancellor the temptation to ingratiate himself with his party by allowing the kind of expansionist tax and spending programme that much of it would have preferred.
His determination to stick by the spending totals was necessary to the Blair project, but it probably helped cost him the leadership when the moment came - a consequence all the more disappointing for him given that he had always been thought of as the dominant figure of the two.
Similarly, whatever criticisms can be made of the regulatory regime on financial services after the 1997 election, granting independence to the Bank of England was a masterstroke; something which every recent Tory Chancellor, with the exception of John Major, had wanted to do but had never been allowed.
Brown's eventual decision not to run after John Smith's death, which ensured what was in effect the coronation of Tony Blair, can be seen in hindsight as avoiding a repeat of the rivalry between Tony Crosland and Roy Jenkins, which had, a generation earlier, arguably prevented either from becoming a Labour prime minister.
On the other hand, another interpretation is possible - one canvassed by former Home Secretary Charles Clarke when the tensions between Blair and Brown first began to surface - namely that it would have been better for Brown to stand against Blair and (in Clarke's view) be defeated.
For damaging in the short term as that might have been, it would have left Brown without that sense that he had been deprived, or perhaps deep down, deprived himself, of the chance to lead.
Certainly the party will now have to resolve the differences between its "gangs" with an open, decisive and perhaps cathartic leadership contest.
In Blair and Brown's case, the uneasy pact between the two men, in which Brown was given a wide remit as Chancellor over domestic policy and in which Blair seems to have given Brown reason to hope that he would make way for him after two terms in office, did not prove a recipe for a stable relationship.
A prevalent view of him for a while as "true Labour" in a way that Blair supposedly wasn't turned out to be at least partly wishful thinking.
After 2007, Brown more full-heartedly espoused the causes he had been so hesitant about during the Blair years, embracing an essentially Blairite attitude to public services, and counterintuitively becoming one of the most successful British prime ministers in Europe since the war.
This was largely but not only because of his management of the financial crisis and his performance at the G20 summit this year, which was widely acknowledged to have been masterful.
Brown can indeed claim, along with Darling, to have led the way in tackling the consequences of the crash with resolution and speed at a time when his political opponents were showing neither.
This is no mean legacy, any more than is his goal of fighting poverty, which remained consistent throughout his political career, up to and including his time at the top.
As a party strategist, Brown may not always have lived up to expectations. In hindsight it's easy to see that he should have gone to the country in 2007.
On the other hand, he was certainly astute in bringing back Mandelson into the Cabinet. Their relationship had its bumps, but the appointment certainly helped to defuse any threat of a Blairite revolt.
Mandelson remained his largely loyal - if hardly uncritical - lieutenant and ally up to election day. That may not have lasted beyond it had Brown chosen to stay amid a growing feeling in the Cabinet that he should go. But that does not take away from the dignity and decisiveness with which he has chosen to do so.
Back in 1994, Brown did in fact make a supreme personal sacrifice by deciding not to run against Blair in the belief that it was the only way to guarantee to return the party he loved to power after 18 years of Tory rule.
It is not too much to say - even if many will say he was bowing to the inevitable - that he has made such a sacrifice again.
It is not simply that he has given the party a chance, however slender, of creating a coalition with the Lib Dems which would make a great deal of ideological sense.
He has allowed it the time and space to renew in time for what still could be an early election.
Appropriately, perhaps, it's a line from the Scottish play that may act as his political epitaph, the one earned by the Thane of Cawdor before Macbeth, that "nothing in his life became him like the leaving of it".
- INDEPENDENT