CANBERRA // The Australian prime minister Julia Gillard was ousted as Labor Party leader today by her predecessor, Kevin Rudd.
The result reflected a move by Labor Party leaders hoping to avoid a huge defeat in upcoming elections.
The ballot took place three years and two days after Ms Gillard ousted Mr Rudd in a similar internal government showdown to become the country's first female prime minister. She lacked Mr Rudd's charisma, and although many Labor politicians preferred her style, her deepening unpopularity among voters compelled a majority to seek a change ahead of elections that are set for September 14 but could be held in August.
Yesterday's 57-to-45 vote makes Mr Rudd leader of the party, and Governor-General Quentin Bryce could make him prime minister as early as today, but he likely will have to demonstrate that he can command a majority of members in the House of Representatives. Labor depends on independents and a minor party for its fragile ruling coalition, but Mr Rudd appeared capable of retaining it after two independent representatives who did not back Ms Gillard's government said they would support his.
The ballot ends a bitter rivalry between Ms Gillard and Mr Rudd that helped create an atmosphere of chaos and disunity. Ms Gillard had survived two previous attempts by Mr Rudd to take over.
The deputy prime minister and treasurer, Wayne Swan, quit after Mr Rudd's victory and was replaced by Rudd ally and the transport minister, Anthony Albanese, in a second ballot.
Even with Mr Rudd in control, polls suggest that Labor could still be defeated by the conservative opposition led by Tony Abbott. But if that happens, Labor lawmakers hope their losses will be smaller under Mr Rudd than they would have been under Ms Gillard.
Ms Gillard threw open her job to a party leadership ballot in response to reports that Mr Rudd's supporters were pushing for a challenge, and he soon announced he would run against her.
"We are on course for a catastrophic defeat unless there is change," Mr Rudd said before the ballot. "And so today, I am saying to you, to the people of Australia, I'm seeking to respond to your call that I've heard from so many of you to do what I can to prevent Mr Abbott from becoming prime minister."
Both Ms Gillard and Mr Rudd had pledged to quit parliament at the next election if they lost.
The two are in many ways political opposites.
Mr Rudd has a reputation for being a masterful campaigner, but he disappointed as an administrator after taking Labor to a resounding victory in 2007.
A Mandarin-speaking former Beijing diplomat turned state government bureaucrat, he has a nerdy style that endeared him to voters. But colleagues complained he was chaotic, bad-tempered and vicious.
Ms Gillard proved calmer, more efficient and more popular with legislators, but she generated extraordinary animosity among voters, partly because she had ousted the prime minister they had elected during his first three-year term.
Mr Rudd had been a popular prime minister who had started sliding in the polls when Ms Gillard, then his deputy, challenged him to a leadership ballot in 2010. He did not contest the ballot when he became aware of the level of Ms Gillard's support and she became prime minister unopposed. Weeks later, she led Labor to a narrow election victory and formed an unpopular minority government with the support of independent lawmakers and a legislator from the minor Greens party.
Mr Rudd's supporters have been accused of undermining Ms Gillard's leadership from the start and have been blamed for damaging leaks against her. Those leaks partially derailed her 2010 election campaign.
John Wanna, who teaches political science at Australian National University and is a Labor supporter, said Mr Rudd has been "rewarded for three years of sabotaging the government".
"Labor's still going for a train crash" at the election, he said. "Half the cabinet can't stand him."
Ms Gillard fended off previous attempts by Mr Rudd to get the prime minister's job back. In a 2012 ballot of Labor party members, she easily defeated him 71 votes to 31. In February, she threw open her job to a leadership ballot, but Mr Rudd refused to challenge and she remained prime minister.
The fact that Mr Rudd never sat for a portrait to be painted to line the walls of Parliament House, as other former prime ministers had done once they had lost power, fuelled speculation that he never abandoned his leadership ambitions.