The Australian Senate has passed the government's so called medevac repeal bill, 37 votes to 35.
It cancels the medevac laws pushed through by the opposition in February that eased the transfer of sick refugees to Australia from offshore detention in Nauru and Papua New Guinea.
The bill's passage hinged on independent senator Jacqui Lambie, who said last week her vote depended on the government agreeing to a condition which she refused to disclose.
Ms Lambie cried in the chamber as she backed the bill but would not reveal whether a deal had been struck to garner her support.
Since the medevac laws were passed in February, 184 people have been transferred to Australia and 418 valid applications have been lodged, according to the Australian newspaper
It reported that as of Monday, 466 asylum-seekers and refugees were held offshore - 208 in PNG and 258 on Nauru - of which 234 had applied for a medical transfer.
It is a very dark day that will mean refugees lives will again be in the hands of politicians who have shown they will deliberately withhold medical treatment from people who desperately need it #auspol @NickMcKim @drkerrynphelps #doctors4refugees— Shamindan (@Shamindan1) December 4, 2019
Opposition MPs, lawyers and advocates were quick to condemn the government for repealing the medevac laws, and Ms Lambie for doing what they allege is a secret deal.
Green Party senator Nick McKim said offshore detention was "a humanitarian calamity" that had caused "misery and suffering".
"Before the medevac laws were in place, 12 people died in offshore detention. Since medevac, not one person has passed away," Mr McKim said.
"A secret deal on such a critical piece of legislation is one of the most reprehensible things you can do as a member of parliament. This deal determines who lives and who dies but nobody except the government and Senator Lambie has any idea what's been cooked up."
David Burke from the Human Rights Law Centre said today was "a shameful day for Australia" on which "lifesaving laws" that allowed doctors to decide when seriously ill people needed to be transferred were repealed.
"We have seen our politicians once again disregard the safety of the women and men it has deliberately kept trapped in offshore detention for more than six years," Mr Burke said.
Advocate Ian Rintoul from the Refugee Action Coalition said the government had resorted to "a shocking campaign of orchestrated leaks, lies and misinformation to repeal the medevac laws, "yet, the minister himself, has directly approved 86 percent of all medevac applications".
Executive director of Melbourne's Refugee Legal, David Manne, said the government had repealed laws that were working well.
"It is an unconscionable and cruel blow to the human dignity and health of people who are exiled by the Australian government in offshore detention... in a system that is laden with systematic neglect of people's basic health needs," Mr Manne said.
"What has underpinned the government's arguments about repeal has been a campaign of fear, of misinformation, of exaggeration about a process that in fact has worked extremely well to ensure that doctors not politicians make recommendations about the health needs of people held offshore."
"If the government has done a deal it is incumbent on the government to reveal what that deal is."