Kevin Rudd has ousted Prime Minister Julia Gillard as leader of Australia's Labor Party. He won 57 votes in a leadership ballot called by Ms Gillard, who received 45 votes.
The change comes ahead of an election called for 14 September, which polls suggest Labor is set to lose.
Mr Rudd is more popular with voters than Ms Gillard, and many believe Labor will perform better in the election under him.
The vote took place three years after Ms Gillard ousted Mr Rudd as prime minister in 2010.
Ms Gillard had said ahead of the vote she would step down from politics if she lost the ballot.
The vote followed months of speculation over the party's leadership and came after a day of drama that saw Mr Rudd's supporters push for a vote.
Shortly before the vote, a key power-broker, Bill Shorten, switched his support to Mr Rudd, saying Labor stood a better chance in the polls with him.
The BBC's Nick Bryant in Sydney says the Labor party wants to hold power and the best way they see of doing that is to restore Kevin Rudd to leadership.
Many people do not think he will win the forthcoming election but he may mitigate the losses and shorten the time they could spend in opposition if they lose, our correspondent says.
The vote makes Mr Rudd the leader of the Labor Party, but not prime minister.
Ms Gillard must write to Governor-General Quentin Bryce stating that she is resigning as prime minister before Mr Rudd can be sworn in.(BBC)