Australian Prime Minister Julia Gillard has survived a leadership challenge from Kevin Rudd in a damaging battle to head the ruling Labor party.
The nation's first female prime minister retained office after beating Mr Rudd 71-31 in a secret ballot of the 103-member Labor caucus, although only 102 votes were ultimately cast with one member absent.
Returning officer Chris Hayes formally declared Ms Gillard re-elected as leader of the parliamentary Labor Party.
He said of the mood: "I think it is fair to say was reasonably tense."
It was among the biggest-ever wins in a Labor leadership ballot.
Ms Gillard called the vote in a bid to end a bitter stand-off with her predecessor, whom she dumped as leader in 2010 in a shock party coup, and bring to a head a period of intense turmoil within the party.
Mr Rudd came to power in a 2007 election landslide that ended more than a decade of Conservative rule, but a series of policy mis-steps saw him lose the confidence of party chiefs and he was axed for the more pragmatic Ms Gillard.
Observers say he never forgave Ms Gillard and he dramatically quit as foreign minister last week before announcing a challenge for the top job, believing only he could save Labor from electoral annihilation in 2013.
Moving forward, Ms Gillard will almost certainly reshuffle her cabinet after several of her ministers came out in support of Mr Rudd, including Resources Minister Martin Ferguson and Immigration Minister Chris Bowen.
She also has to announce a replacement for Mr Rudd as foreign minister, with Defence Minister Stephen Smith, who preceded Mr Rudd in the portfolio, seen as the favourite.
Mr Rudd will now retire to the backbench and has pledged "unequivocal support" for Ms Gillard, with both camps urging unity to try and repair the damage done to the party.
Speaking shortly before the vote, he reiterated that he would not mount another challenge if he lost.
"I won't be initiating any further challenge against Julia," said Mr Rudd, who has been subjected to scathing criticism from fellow ministers who have described him as "dysfunctional".
Yet, Mr Rudd remains popular outside the caucus, with his resounding defeat coming as a Newspoll for The Australian, taken over the weekend, showed 53% of voters favour him as prime minister to Ms Gillard's 28%.
Mr Rudd is also far more popular than opposition leader Tony Abbott, with the poll of 620 people showing 53% think he would be a better prime minister to Mr Abbott's 34%.
Support for Ms Gillard, meanwhile, has declined, with her satisfaction rating falling from 32% to 26% in the past fortnight.