Just over three years on from the night Kevin Rudd was ousted in a stunning coup that gave Australia its first female prime minister, he has been returned to the prime ministership by a Labor Party fearful of suffering a catastrophic defeat at the hands of Tony Abbott.

With the support of Bill Shorten, one of the key plotters against him in 2010, Rudd defeated Gillard in a ballot initiated by the prime minister in response to claims the Rudd camp had circulated a petition calling for a ballot tomorrow. Gillard struck first and attempted to take the Rudd camp by surprise, bringing on a spill this evening and demanding Rudd resign from politics if he lost, as she would if she were defeated.

It was a high-stakes ploy from a woman who has shown remarkable tenacity and cunning in fighting off Rudd on two occasions since 2010, but it wasn’t enough. Shorten’s declaration, a few minutes before caucus met, that he was backing Rudd because only he could stave off a defeat that would obliterate the government’s legacy, sealed Gillard’s fate. However, the Rudd camp was very confident of victory from the moment Gillard called the spill. Rudd won the ballot 57-45. No change to the deputy position, from which Wayne Swan has resigned, has yet been announced.

In announcing he was running this afternoon, Rudd admitted he had repeatedly said he would never challenge Gillard — a commitment made after he lost in 2012 — but said his Labor colleagues and voters across Australia had been imploring him to run and that Tony Abbott with a Senate majority posed a huge threat to Australia.

Sign up for a FREE 21-day trial and get Crikey straight to your inbox

By submitting this form you are agreeing to Crikey's Terms and Conditions.

The deputy leadership also went to a vote: Anthony Albanese defeated Simon Crean, the man who most publicly pushed for resolution in March, 61-38.

The wider shake-up within the government will be significant, with several ministers including Stephen Conroy, Craig Emerson and Joe Ludwig joining Wayne Swan on the backbench; Conroy has quit as Senate leader and will be replaced by Penny Wong (she was elected unanimously). Of these, the most crucial role is that of treasurer, for which Chris Bowen has long been tipped.

“The key tactical question of the day is at what point Shorten defected, and whether it was his defection that drove the Rudd camp to break cover today …”

With Australia’s first female PM presumably now departing politics (and not inappropriately, on the same day Tony Windsor and Rob Oakeshott, who delivered her office after the 2010 election), Labor has a chance to prosecute the case against Tony Abbott without the incessant distraction that the leadership has proved since the first leak destabilised Gillard’s election campaign in July 2010. However, as the example of Gillard periodically demonstrated, even when Labor has had clear air in which to attack Abbott, it has failed to make a dent on his huge polling lead.

The key tactical question of the day is at what point Shorten defected, and whether it was his defection that drove the Rudd camp to break cover today with its spill petition. Labor sources say Shorten has been shifting for over a week, and that his dramatic switch to Rudd just before Caucus met was no last-minute move but well prepared ahead of time.

How the Parliament will deal with a Rudd prime ministership is now the crucial issue: he will surely face a vote of no-confidence tomorrow that will test the support of the large group of independents for Labor. Beyond that lies an election that is no longer guaranteed to be in September. That was Gillard’s date, and Rudd is not bound by it.

And while Gillard will be leaving politics, many of her followers will not be. And they will forever remember Rudd’s refusal to ever give clear air to the woman who replaced him. Rudd may have gained his revenge, but his behaviour over the last three years may mean others treat him the same way they believed he treated Gillard.