The High Court ruling that Immigration Minister Chris Bowen had no power to send asylum seekers to a country without international or legal protections for their human rights has left Gillard with lose-lose options.
The Government could try to change laws to dodge the ruling, but would be outnumbered by Opposition and Greens votes, and bring intense domestic and international condemnation upon itself.
It could - as it is already considering - re-open former Liberal Prime Minister John Howard's "Pacific solution" detention centres on Manus Island in Papua New Guinea and/or Nauru.
But the High Court's ruling could close off any offshore options and, even if this was legally possible, Gillard would be placed in the humiliating and potentially dangerous position of returning to a Coalition policy Labor condemned as "inhumane, unfair and wasteful" and which it dumped immediately after winning power in 2007.
The remaining option is to admit asylum seekers back on to mainland Australia, bringing with them further huge political problems involving mandatory detention.
Bowen said the Government was not ruling out any options, including a return to Nauru or even the reintroduction of highly-restricted temporary protection visas for asylum seekers, reviled by Labor in Opposition and axed after it came to power.
Some remote camps condemned by United Nations and human rights groups have already been re-opened to handle the overflow from Christmas Island, and the re-commissioning of a major facility such as the mothballed Baxter Detention Centre near Port Augusta in South Australia would polarise the country.
Things will only get worse if predictions of increased boat voyages from Indonesia in the wake of the ruling are correct, reversing what the Government claims has been a halving in the number of arrivals since the Malaysian swap deal was announced.
Bowen said the number of people in detention had fallen by 2000 in the past three months.
"I think you can expect people smugglers to be capitalising on this arrangement and to say that, 'you can come to Australia now because the Malaysia agreement has been ruled invalid by the High Court'," he said.
In Brisbane yesterday, Gillard said that the ruling represented a missed opportunity: "A missed opportunity to enhance our region's response to the evil of people smuggling, a missed opportunity to make a real and important contribution to the region's approach to the transnational crime of people smuggling ... and a missed opportunity to send a message to asylum seekers not to risk their lives at sea and get into boats."
Initial legal advice on the ruling received by the Government is believed to have warned that any bid to process asylum seekers in the third country - including Manus Island and the Opposition's favoured Nauru - could also be blocked.
"There are questions over the future of offshore processing arrangements that must be considered," Gillard said.
"And it is far from clear whether the court's ruling would, practically speaking, permit the operation of offshore processing in other locations, even in locations where offshore processing has been conducted in the past."
For the Coalition, the ruling is mana from political heaven.
"This is a government that lurches from one self-made crisis to the next, whether it is Pink Batts, the National Broadband Network, live cattle or border protection, it is just one bungle after another," Opposition Leader Tony Abbott said.
"This is a government mired in incompetence."