Canberra: Australia`s first female Prime Minister, Julia Gillard, was sacked by her party and replaced by Kevin Rudd, the man she ousted three years ago.
After an unprecedented day of political bloodletting in Canberra, Kevin Rudd beat Gillard to become Labor party leader in a ballot of MPs by a margin of 57 to 45.
It is only the second time a sitting Australian prime minister has been removed from office by their party. Rudd`s removal was the first.
Gillard laid down the challenge to Rudd, when she called on Wednesday for a do-or-die ballot on the condition that the loser would retire from parliament to end the debilitating Labor leadership war.
Gillard said she had called the ballot on the basis that "if you win, you are Labor leader; if you lose, you retire from politics" and was now expected to retire.
A cabinet reshuffle is expected.
The day of high drama began in the morning, when supporters of Rudd, who had advocated his return to the leadership for virtually the entire three years of the hung parliament, began circulating a petition to try to force a contest in this, the last sitting week of parliament before the September election.
Within hours, Gillard went on the attack and made the dramatic decision to hold a snap vote on her position and, in effect, the job of prime minister.
"It is in the best interest of the nation and the Labor party for this to be resolved," she said.
"This is it. There are no more opportunities, tonight`s the night," the Guardian quoted her, as adding.
Wednesday`s change of leader follows months of speculation, during which Gillard made it clear that she would not stand down, despite opinion polls that repeatedly showed Rudd to be the more popular leader.
Once Gillard called the leadership ballot, the third time she had agreed to contest her position in as many years, Rudd made his pitch to return, saying the party was heading for a catastrophic defeat if nothing was done.
It was a U-turn from his position two months earlier when he declared there was no circumstance under which he would return to the party`s leadership.
Rudd said he had changed his mind, because of "tens and thousands of ordinary Australians, who have been asking me to do this for a very long time. This has now become urgent. I therefore believe with all my heart that I owe it to offer the people of Australia a viable alternative."
The ballot looked very close until 15 minutes before the vote when one of Gillard`s key backers, Bill Shorten, who had helped put her in the top job, changed sides.
"The future of this nation and the Labor party is at stake, therefore I shall be supporting Kevin Rudd tonight," he said.
It is unclear what will happen now. For Rudd to be sworn in, Gillard must recommend this course of action to the country`s governor general, the Queen`s representative in Australia and head of state.
Assuming that this will happen, Rudd may then face confidence vote in parliament on Thursday, the last sitting day before the election on 14 September. It is not certain he would win this vote, as independent MPs who have kept Gillard`s minority government in power have not guaranteed their continued support.