Tony Blair paid tribute to the man who helped him to build New Labour, as Gordon Brown handed over the keys of 10 Downing Street to David Cameron.
Blair said he had spoken to the outgoing prime minister, and hailed Brown's "extraordinary service to social justice".
In a statement, he said: "I spoke to Gordon Brown tonight in a warm conversation that reflected a friendship of almost 30 years' duration. I pay tribute to the dignity, courage and leadership he has shown in these last few days and to the quite extraordinary service he has given to our country in 13 years of government as chancellor and prime minister and to the cause of social justice at home and abroad."
Other senior Labour politicians also paid tribute to Brown. Lord Mandelson said: "He has shown giant dignity and, like of all of us, he may not be faultless but he is certainly fearless."
It was "typical of Gordon to take all the responsibility on to his own shoulders" for Labour's performance in the election, Mandelson said.
"What everyone has to remember in the Labour party is that we have had a very good, very strong, quite a long innings," he told BBC News. "And when you have gone through three terms, you know people tend to think it's time for somebody else, it's somebody else's turn, and we were fighting against that.
"Just remember, not so many months ago people were saying that David Cameron was simply going to waltz into Downing Street, that it would be a Tory walkover. Well, we gave them quite a fight."
The former foreign secretary David Miliband said: "Gordon Brown has been a towering figure in British politics. He helped to save the Labour party in the 1980s and 1990s. Every community in Britain will see the benefit of his decisions for years to come.
"Around the world, many lives are worth living as a result of the decisions Gordon took as chancellor and prime minister. His closing words and the values they embodied are a credit to him, our party and our country."
The former education secretary Ed Balls, a close ally of Brown since Labour's last period in opposition, told Sky News: "Obviously, it is a sad day for the Labour party, but at the same time Gordon Brown can go out with pride in his great achievements in government over 13 years. It's the end of an era. It's the end of the Gordon Brown era."
Balls said it was a "disappointment" for Labour that the Liberal Democrats had shown themselves willing to go along with Conservative plans to reduce state spending immediately, rather than maintain it until the economic recovery is firmly established.
The former home secretary David Blunkett said: "This is a sad moment and one in which to spare a thought for Sarah and the two young boys. It is now the moment for the Labour party to reflect on what has happened – but, far more importantly, what the future holds.
"There can be few tasks in life as thankless as being prime minister. This is true in spades when dealing with a global recession in which everywhere else in the world is affected, but your own electorate have no one else to blame but you. That is why everyone, including those who have been vitriolic about Gordon Brown, should have the decency to say thank you for his tremendous contribution to getting nations to work together over the last two years to combat what would have been a global depression."
Scotland's first minister, Alex Salmond, described Brown as "almost a force of nature". He said: "For 30 years, Gordon Brown has been at the very forefront of first Scottish and then UK politics. No one could doubt his powerful intellectual capacity, his commitment, and the strength with which he pursued his objectives."
The former Scottish secretary Jim Murphy said Brown had served the people "unstintingly".
"Gordon Brown's contribution to public life at home and across the world is immense, impressive and substantial. Scots are proud of him, and proud of what he has done to make life better for those forgotten by others. He would not walk on by when others were in need," Murphy said.
The Irish prime minister, Brian Cowen, said Brown had been a good friend to Ireland throughout his career in government. "He showed his commitment to peace in Northern Ireland and to positive British-Irish relations in his extraordinary personal contribution to the talks that led to the Hillsborough agreement earlier this year," the taoiseach said.
"He has also provided strong and insightful international leadership in the global economic crisis and in the fight against poverty and disease around the world. I know that he has always tried, in all he has done, to work for the good of everyone in British society. I wish him well for the future and look forward to working with his successor."