© Provided by ABC NewsLabor secured the support of most of the crossbench to win the Lower House vote 75 to 74.
The future of the Coalition's hold on power is at risk with the Federal Government becoming the first to lose a vote on its own legislation in almost 80 years.
The majority of the crossbench and Labor joined forces in the House of Representatives to pass amendments to give doctors a greater say on refugee medical evacuations.
The amendments were agreed to by the Senate late last year, after Labor and the crossbench forced a series of measures into a government migration bill.
Labor secured the support of most of the crossbench to win the Lower House vote 75 to 74 on the first sitting day for 2019.
Attorney-General Christian Porter presented legal advice from solicitor-general Stephen Donaghue at the last minute, suggesting the amendments agreed to by the Senate would be unconstitutional.
But Mr Donaghue also pointed out there was case law suggesting the High Court was generally reluctant to intervene in these matters, because it related to sections of the Constitution that gave power to the Parliament to conduct its own affairs.
People smugglers 'the only winners'
Greens MP Adam Bandt said the crossbench and refugee advocates should claim credit for the outcome.
"By all working together and putting refugees first, we've just made a huge difference," Mr Bandt said.
"The Greens worked with the crossbench and constructively held Labor to account, stopping too much power from remaining in (Home Affairs Minister) Peter Dutton's hands."
But former prime minister Tony Abbott took to Twitter to warn the changes would offer an incentive for people smugglers.
"People smugglers and their customers are the only winners from Labor's weakening of our border protection policies because ample medical treatment offshore and onshore was already available.
"Under Labor, it's get on a boat, get to Nauru, get sick and get to Australia."