The government has long hoped to overturn legislation allowing the medical evacuation of refugees and asylum seekers from Manus Island or Nauru to Australia for health treatment, which was passed late previous year.
It won support from key independent MP, Jacqui Lambie, to get the numbers in the Senate on Wednesday. The vote was tied, with Lambie the crucial swing vote.
Opposition senators accused the government of "secrecy" in striking the last-minute deal.
"They say without their flawed Medevac laws there is no process for medical practitioners in terms of the transfer of individuals to Australia", he said.
Under the Migration Amendment (Repairing Medical Transfers) Bill which passed in February this year, just under 180 people have been moved to Australia for medical treatment. "This deal determines who lives and who dies but nobody except the government and Senator Lambie has any idea what's been cooked up".
"Asylum seekers and refugees who remain indefinitely contained on Nauru and PNG have been blocked again from accessing treatment for critical health conditions where adequate care is not available locally", said Paul McPhun, executive director of Médecins Sans Frontières Australia.
In an emotional speech Lambie, breaking down in tears, told the Senate: "I'm not being coy or silly when I say I genuinely can't say what I proposed".
"We know that these people have self-inflicted... like palm oil into their bloody penises, for crying out loud".
"I know that's frustrating to people and I get that - I don't like holding things back like this but when I say I can't discuss this publicly because of national security I am being 100 per cent honest to you". Refuting claims that medevac has created a national security problem, he argued appropriate medical care is a basic human right.
Judiciary Committee Republicans say Democrats ignoring legislation to focus on impeachment
The president predicted that the ratings will be bad for Wednesday's first impeachment hearing in the House Judiciary Committee. The report "reads like the ramblings of a basement blogger straining to prove something when there is evidence of nothing".
Fighting back tears, the Senator said it had been a hard decision she had worked out with the Government over the past week.
Greens leader Richard Di Natale demanded to know who was lying.
But Labor home affairs spokeswoman Kristina Keneally has questioned a lack of transparency around the alleged deal clinched between the Government and Senator Lambie. "It's very clear", he told a press conference following the vote succeeding.
"The repeal that has been pushed through by the Australia Government is not only needlessly cruel".
"So we will continue to use the arrangements that we have in place to be able to resettle people and that is the assurance that we have provided".
If you think about it, this is all Peter Dutton's fault.
Crossbench Senator Jacqui Lambie (right) speaks with the Leader of the Government in the Senate Mathias Cormann.
"There is no secret deal, there is no secret", the Wiseau-esque words uttered by Matthais Cormann shortly before the repeal of the medevac bill is at best, prophetic, and at worst, absolute bull plop.