Former Prime Minister Gordon Brown is to stand down as an MP at the next general election.
The Kirkcaldy and Cowdenbeath MP ruled out a Labour peerage, as he made the announcement to constituency activists.
Mr Brown was chancellor from 1997 to 2007 before spending three years in 10 Downing Street.
Labour leader Ed Miliband described Mr Brown as a "towering figure", while David Cameron said he had "given a huge amount" to public life.
Under Mr Brown's leadership, Labour lost power in 2010 after 13 years in government, recording its worst general election result since 1983.
Since then, he has kept a generally low profile, making an intervention in a debate on the phone-hacking scandal and later entering the Scottish independence campaign.Leaving Westminster
Addressing Labour Party activists in his constituency in Fife, Mr Brown said he was in "no doubt" that stepping down was the right thing to do.
But he stressed his continuing commitment to the constituency at the meeting of supporters, friends and wife and children.
"We are not leaving Fife. It is London that I am leaving. For the avoidance of doubt, I'm not going back to Westminster nor to House of Lords.
"It is Fife where our home is and where we will be, where our children John and Fraser - who are here tonight - are happily at school."Analysis
James Landale, BBC deputy political editor
To his opponents, Gordon Brown was one of the worst prime ministers of the post-war era, a man whose ambition outpaced his ability.
To his supporters, he was a giant of his age, a politician who helped save the global economy and the United Kingdom. He could be brilliant and inspirational. He could be insecure and suspicious.
Above all, he was a complex figure whose character shaped his leadership, from his moral seriousness to his petty rivalries.
Read more of James Landale's analysis here.
Mr Brown told the meeting that although he was standing down next May, "I want to renew my commitment to public service".
"So, in the next few months I will do everything I can to secure the election of my successor here as the Member of Parliament and the election of Ed Miliband as prime minister under a Labour government," he pledged.
He said he would also use the skills he learned "fighting the cause of Scotland in Britain" and to "fight also the cause of Britain in Europe".
"And, although I have no desire to return to frontline politics, if the health service needs an additional champion, if the cause of social justice needs someone else to speak up for it, if the cause of Scotland in Britain needs someone to speak for it, and if I feel I can make a difference, then I will do everything in my power to play my part in securing the election of a Labour government in the Scottish parliament elections in 2016 as well," the MP added.'My hero'
Mr Brown, who first entered Parliament in 1983, confirmed his intentions in a speech to his constituency Labour Party on Monday evening.
His wife, Sarah, who was at the event, told BBC Scotland it was "quite an emotional day".
"I've known Gordon always as a Member of Parliament and I think most decisions we'd make together as a family or as a couple but actually this one was for him alone. So, yeah, it's the end of this particular era."
Asked what he and the family would do next, she said they had both been working on global education projects and would "combine our efforts" to try to tackle the problem of "58 million children who don't get a single day at school around the world".
When pressed about criticism of her husband during his career, she said she didn't read "every comment" and stood by past remarks that he was "my hero".
Alastair Campbell, Tony Blair's former director of communications, told BBC Radio 4's Today programme Mr Brown was "one of the political figures of our time".
"At his best to work with he was absolutely brilliant. And equally at other times he could be a nightmare to work with," he said.
"I think sometimes with really great figures there is always a downside and that was the downside... this idea that he was brilliant but he was also impossible."
"You see this in a lot of people there is often this link between hyper achievement and psychological issues. I've got them myself, I've been very open about that," Mr Campbell added.
Mr Campbell described the relationship between Blair and Brown as like Lennon and McCartney and said Mr Blair had come close to sacking Mr Brown.
The former spin doctor worked closely with Mr Brown when he was chancellor.
"I used to go to meetings every single morning. You never knew what mood he'd be in but whatever it was he was worth working with because we did make things happen," Mr Campbell said.
"I always gave him the benefit of the doubt - except when he could be totally nightmarish and then we all lost it."Charity work
The BBC's assistant political editor Norman Smith said Mr Brown's decision to step down was "not a huge surprise", with the former PM having been a "relatively infrequent visitor to Westminster" since the 2010 general election.
Since resigning as prime minister and Labour leader, Mr Brown has focused on charity work and his role as United Nations special envoy for global education.
Mr Brown told the meeting that he would continue this work from Fife.
He returned to the political spotlight during the latter stages of the Scottish independence referendum campaign with the result in the balance, helping to secure the vote against independence.
A key part of his role was setting out a timetable for boosting the Scottish Parliament's powers if voters rejected independence, a timetable which was backed by the leaders of the three main pro-Union parties.
Supporters later urged him to contest the leadership of the Scottish Labour Party but he declined.
Mr Brown said he did not want to announce his intention to step down until he was sure that the promises of further Scottish devolution, made during the referendum campaign, would go ahead.
He had a majority of 23,000 at the last general election.Treasury decade
As chancellor Mr Brown oversaw a decade of growth, made the Bank of England independent and played a key role in keeping the UK out of the euro.
He took over as prime minister from Mr Blair without a contest in 2007 but his premiership, which suffered when he decided at the last minute against calling a snap election that autumn, was dominated by the financial crisis and bank bailouts as the UK slipped into recession with a soaring deficit.
He saw off frequent rumours of challenges to his leadership by fellow Labour MPs, but his popularity never returned to the levels of his early days as PM.
The low point came during the 2010 election campaign, when he was recorded referring to a voter he had just spoken to in Rochdale, Gillian Duffy, as a "bigoted woman". He later went to Mrs Duffy's house in Rochdale to apologise, saying he was "mortified".
After the 2010 general election, he stayed on as prime minister for five days during negotiations between the parties.
With the Conservatives and the Liberal Democrats poised to form a coalition government, he resigned as prime minister and stepped down as Labour leader.
Mr Cameron said: "Gordon has given a huge amount in terms of public service and his contribution in government and Parliament, and I am sure he will go on contributing to public life even after he has left the House of Commons."'Uneasy temperament'
Praising his legacy, which Mr Miliband said included the minimum wage and the preservation of the United Kingdom following September's Scottish independence referendum, Mr Miliband said his predecessor as Labour leader "will obviously be missed" but "will carry on serving the Labour Party in other ways".
"Gordon has been a towering political figure for a generation," he said.
"He's been instrumental in many of the Labour government's past achievements like investment in health and education and the minimum wage. He worked with other world leaders to stop the financial crisis becoming a great depression. And even recently he played a really important role in the Scottish referendum making sure there was a no vote."
Former Labour Cabinet minister Lord Mandelson, a one-time foe of Mr Brown's who was brought back into government by him in 2008, said the ex-PM had been instrumental in salvaging the global financial system in the aftermath of the 2007 banking crash.
Despite having what he described as an "uneasy temperament" and a capacity to "sometimes see conspiracies where none existed", Lord Mandelson said "no-one could take away" his achievements in office.
"The balance of achievements will be very much in Gordon Brown's favour," he told the BBC.
Labour's shadow Scotland secretary Margaret Curran said: "The whole Scottish Labour Party wishes Gordon well and while he will no longer be an MP, he still has a great part to play in Scottish politics and as an international campaigner for education."
Scotland's First Minister Nicola Sturgeon said Gordon Brown had made an "enormous contribution" to Scottish, UK and international politics.
David Cameron has been accused of "gossiping" about the Queen after being filmed sharing details of a private conversation:http://bbc.in/1smH3IS
He said the Queen "purred" when he told her Scotland had voted "No" to independence, adding "I've never heard someone so happy".
Scotland's First Minister Alex Salmond said Mr Cameron should "hang his head in shame".
So confident was Prime Minister David Cameron - he had seen the polls putting the pro-Union camp 20 points or more ahead - that Salmond did not want a referendum that he took to taunting him from the Conservative Party conference stage to name a date.
When the two men finally sat down to hammer out an agreement on the referendum, many Westminster pundits thought Cameron had outfoxed Salmond by refusing to allow a third question on the ballot paper.
Cameron was confident that the SNP could not win in a straight yes/no contest, so rejected Salmond's demands for a third "devo max" option - more powers for the Scottish Parliament in lieu of full independence - to be added to the ballot paper.
"He [Salmond] may well be forced to hold a referendum knowing that he will lose. The greatest political conjuror of recent times will have run out of tricks," wrote commentator Steve Richards in The Independent.
In the event, Salmond came far closer to winning the referendum than anyone thought possible when it was announced. The Yes campaign's late surge in the polls shocked the Westminster establishment into offering what may amount to a form of "devo max" after all, before a single vote had been cast.
Perhaps the old conjuror has a few tricks left up his sleeve after all.
Salmond called the referendum a once in a lifetime opportunity for the Scottish people. He will soon turn 60 and may not get another shot at it.
That, he suggested, was one reason why he had decided to step down as SNP leader. Twenty years as SNP leader, with a four year break, and seven years as first minister, something that has been "the privilege of my life" was, he said, a "fair spell".
But with characteristic defiance, he said Scotland "could still emerge as the real winner" and suggested his legacy was the tens of thousands of "energised activists" that had been drawn into politics through the Yes campaign, "who I predict will refuse to go meekly back into the political shadows".
He may have departed the stage but, he told the reporters, he would "continue to contribute" and said the dream of Scottish independence "will never die".