By James Grubel

CANBERRA (Reuters) - Kevin Rudd returned as Australian prime minister on Wednesday, executing a stunning party room coup on Julia Gillard almost three years to the day after being ousted by his former deputy and less than three months out from a general election.

The reinstatement of Rudd as leader was a last-ditch effort to shore up support by the governing Labor Party, which opinion polls show faces a battering at a poll scheduled for Sept 14.

The Mandarin-speaking former diplomat draws strong popular support but has divided and destabilized his party after launching two failed leadership bids in the past 18 months.

Analysts said the move could backfire.

"I don't think it will help Labor. I think they've dug themselves a deeper grave," said John Wanna, professor of politics at the Australian National University.

The return of Rudd could now see Australia go to an election in August rather than the set date of September 14 to cash in on his greater popularity with voters and an expected honeymoon period with the electorate.

The leadership change followed a series of opinion polls showing Gillard's minority government could lose up to 35 seats, giving the conservative opposition a massive majority in the 150-member parliament.


Gillard, Australia's first female prime minister, stuck to her promise to quit parliament if she lost the ballot.

"I am very proud of what this government has achieved which will endure for the long term," a gracious but business-like Gillard told reporters, congratulating Rudd on his victory.

Senior ministers including Treasurer and Deputy Prime Minister Wayne Swan, Education Minister Peter Garrett, Trade Minister Craig Emerson and Climate Minister Greg Combet announced their ministerial resignations in the wake of the coup. Transport Anthony Albanese was named deputy leader.

Gillard struggled to win public support despite economic growth, low unemployment and low interest rates at a time when other developed countries are struggling to keep out of recession.

Gillard has also pushed social reforms that pour money into schools, and which help disabled people gain access to much-needed free care, but the changes have done little to shift her dwindling support in opinion polls.

Voters have also remained angry that her government, which holds a one-seat majority with support from the Greens and a clutch of independents, introduced a controversial carbon tax in a backflip from her 2010 election promise not to do so.

Two independent lawmakers and the Greens said they would continue to support a Rudd government in the hung parliament.

Nick Economou, from Melbourne's Monash University, said the only potential policy change would be on the carbon tax, and Rudd could move quickly to shift to a floating carbon price.

But the change won't help Labor survive the election.

"Australian voters don't like disunited parties, and these guys are nothing if not disunited," he said.

Like Gillard, Rudd is a strong supporter of both Australia's military alliance with the United States and of growing ties with top trading partner China.

Opposition leader Tony Abbott, the favorite to win the coming elections, has promised to scrap the carbon tax and a 30 percent tax on iron ore and coal mine profits if he wins power.

Abbott has also promised tighter control of public spending, a speedier return to surplus budgets, and stronger economic growth if he wins office.

(Additional reporting by Lincoln Feast in Sydney; Editing by Nick Macfie)

Watch Gillard's remarks after her departure, posted by the Australian Broadcasting Corporation (ABC) on Wednesday, below.