It is the first time in over seven decades that the incumbent government lost the vote on its own legislation.
The ALP and key crossbench and independent MPs and Senators came together to vote the bill through, delivering a historic blow for the government on the eve of an election.
An Afghan asylum seeker allegedly grabbed two nurses' bottoms after being rushed from Nauru to Australia for medical treatment. "Every arrival is on Bill Shorten [Leader of the Labor Party] and Labor's head".
Mr Shorten proved the government's vulnerability by gaining support from five independent and one Greens MP to gain 75 votes on the floor of the House of Representatives to pass the new rules for refugee medical transfers.
About 1,200 refugees are estimated to be in exile in Nauru and Papua New Guinea's Manus, where they've been indefinitely detained for nearly six years.
The bill must be approved by the upper house to become law, but is likely to pass, as the Senate supported an earlier version a year ago.
The Christmas Island center, on par with detention facilities on Nauru and Manus Island, has become a symbol of Australia's controversial migration policy, associated with torture, mistreatment, and abuse.
"My job now is to ensure that the boats don't come", he told reporters at Parliament House on Wednesday.
"I believe that we can keep our borders secure, we can uphold national security but still treat people humanely", Shorten told Parliament.
Prime Minister Scott Morrison, who had staunchly opposed the bill, responded by saying the measure could undermine national security, offering a preview of what is likely to be his campaign pitch, and the election's central issue.
"This is merely codifying something that the government itself says is happening now".
"If we're sending people who really need [help] to Australia already, why make a big deal of it, and why create a symbol that says we're going to get even kinder?"
The federal opposition is introducing amendments to overhaul existing laws, lifting jail time for corporate crimes from 10 to 15 years and more than doubling the proposed cap on financial penalties.
Labor's Senate leader Penny Wong said Mr Morrison was playing politics ahead of the election, likely to be held in May.
The changes included a provision that only the 1,000 asylum seekers now held on Nauru and Papua New Guinea and not any future arrivals would be considered for medical evacuation under the new regime.
Speaking before the vote, Morrison said that the changes would encourage people-smugglers and provoke a new flow of arrivals.