Australian prime minister Julia Gillard bounced out after being photographed knitting a toy kangaroo for Kate's baby

Ms Gillard announced a ballot of lawmakers in the ruling Labour party

Mr Rudd beat his rival with 57 votes to her 45, returning officers said



Ms Gillard had ousted Mr Rudd as prime minister three years ago



Australian prime minister Julia Gillard has been ousted as Labour Party leader by her predecessor Kevin Rudd by MPs hoping to avoid a huge defeat in upcoming elections.



The ballot took place three years and two days after Ms Gillard removed Mr Rudd in a similar internal government showdown. It makes him leader of the party, but not prime minister.



Ms Gillard, who had thrown open her job to a leadership ballot in response to reports that supporters of her rival Mr Rudd were gearing up to challenge her, lost by 57 votes to 45.

Scroll down for videos



Defeated: Julia Gillard, seen arriving ahead of the leadership ballot at Parliament House in Canberra, received 45 votes to Kevin Rudd's 57

Triumph: Kevin Rudd, seen left leaving the caucus room after the ballot, has ousted Ms Gillard as leader of the ruling Labour Party

Mr Rudd will have to demonstrate that he can command a majority in the House of Representatives before the governor-general makes him prime minister. If he cannot, opposition leader Tony Abbott could be asked to form a government or the elections could be moved up from September to August.



The 55-year-old Queensland Labour MP beat British-born Ms Gillard, 51, by 57 votes to 45, a ballot returning officer announced, as Labour's popularity slid down the opinion polls and Ms Gillard lagged far behind her Liberal opponent as preferred leader.

Stepping down? Ms Gillard, pictured speaking in the parliament in Canberra today, is now expected to leave politics

Challenge: Julia Gillard, seen left, announced the ballot amid reports supporters of her intra-party rival Kevin Rudd, right, were gearing up to challenge her leadership



Even while voting was still under way, Ms Gillard's supporters had conceded that she would be ousted - in a reversal of her own ousting of Mr Rudd in 2010.

Ms Gillard had come under fire this week for posing for a photo shoot which showed her knitting a kangaroo as a gift for Prince William and the Duchess of Cambridge's baby.

Critics described the photos of the former leader, widely regarded as lacking home-making instincts, as 'contrived'.



Stunt: Gillard had come under fire for publicity photos showing her knitting a toy kangaroo as a gift for the Duke and Duchess of Cambridge's baby

The former leader, who arrived in Australia from Barry, Glamorgan, with her parents as a five-year-old, is now expected to leave politics.

She had put on a brave face in recent months as Labour's popularity slumped. Many voters said they did not trust her after she promised that there would be no carbon tax under the government she ruled, only to bring in the measure.

While there was no immediate official announcement that Ms Gillard had lost the ballot of senior Labour party members, Australia media were reporting within minutes that Mr Rudd had got his old job back.



Born on a Queensland dairy farm, he was prime minister from 2007 to 2010, when he realised he did not have enough support within the party to survive his position and he resigned as both prime minister and leader of the Labour Party.



Ms Gillard stepped into the position unopposed. Since then, Mr Rudd's supporters have spoken of how he had been stabbed in the back by Australia's first female prime minister.



Mr Rudd is now expected to call a general election in August - a month earlier than the September election announced by Ms Gillard.

In a day of drama in Australian politics, Mr Rudd told reporters that people were angry that Labour had been left with little choice other than to vote for the Liberal (conservative) opposition, led by Tony Abbott.



'What the nation needs now is strong proven economic management,' he said, claiming that 'many, many MPs' had asked him to return to the leadership.



He said he was going to challenge Miss Gillard for the top job 'for the nation's sake', promising that their would be no retribution against MPs who had shown their support for Ms Gillard.

Rivalry: Mr Rudd has won his old job back three years after Ms Gillard ousted him as prime minister

Recent opinion polls showed that the party could face huge losses in elections set for September, but that Mr Rudd would be a more popular leader than Ms Gillard.



'I wouldn't be putting myself forward unless I had a degree of confidence about the support of my parliamentary colleagues,' Ms Gillard said ahead of the ballot.



While not mentioning Mr Rudd by name, she said the loser of the ballot should quit Parliament at the election. She said it was not right to have a 'person floating around as the potential alternative prime minister'.

Ms Gillard's announcement followed media reports that a petition was circulating among the 102 Labour Party lawmakers.



A special party meeting to discuss a leadership ballot would have been called if at least 34 lawmakers - 30 per cent - signed that petition, but her announcement eliminated that step.

Mr Rudd's supporters are desperate to have a ballot before Parliament rises for the last time on Thursday ahead of elections set for September 14.

Opinion polls suggest Labour could lose about half of its 71 seats in the 150-seat House of Representatives, where parties form the government.



Mr Rudd had been a popular prime minister who started sliding in the polls when Ms Gillard, his then deputy, challenged him to a leadership ballot three years ago.



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, Ms Gillard led Labour 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.



In a 2012 ballot, Ms Gillard easily defeated Mr Rudd 71 votes to 31. In February, she threw open her job to a leadership ballot to end leadership speculation, but Mr Rudd refused to challenge and she remained prime minister.



Opposition leader Tony Abbott challenged Ms Gillard on Wednesday to bring forward the election to August 3 because of the new wrangling over leadership.



'Given the paralysis now gripping her government and irreconcilable differences in her party over its leadership, will she bring forward the election date to August 3 and let the people decide who should run our country?' Mr Abbott asked in Parliament.