The Australian government has said it will reopen a mothballed island detention camp in anticipation of a new wave of asylum seekers arriving by boat.

It comes after the country’s parliament passed legislation that would give sick asylum seekers easier access to mainland hospitals.

The Christmas Island immigration detention camp, south of Jakarta, Indonesia, was a favourite target of people smugglers who brought asylum seekers from Asia, Africa and the Middle East in rickety boats from Indonesian ports before the trade virtually stopped in recent years.

Prime Minister Scott Morrison said a security committee of his cabinet agreed to reopen the camp on the advice of senior security officials.

The decision was made before the Senate passed legislation 36 votes to 34 that would allow doctors instead of bureaucrats to decide which asylum seekers on camps on the Pacific island nations of Papua New Guinea and Nauru can fly to Australia for hospital treatment.

Mr Morrison’s conservative government argues that the bill, passed 75 to 74 by the House of Representatives on Tuesday, will undermine Australia’s tough refugee policy.

The policy banishes asylum seekers who attempt to reach Australia by boat to the Pacific island camps in a bid to deter other asylum seekers from making the perilous voyage.

“My job now is to ensure that the boats don’t come,” Mr Morrison told reporters.

“My job now is to do everything in my power and the power of the government to ensure what the parliament has done to weaken our border does not result in boats coming to Australia.”

Mr Morrison said he would repeal the “foolish law” if his government was re-elected in an election due in May.

Australian governments rarely lose votes in the House of Representatives, where parties need a majority to form an administration.

Legislation has only been passed in the House against a government’s will in recent decades 1929, 1941, 1962 and 2013.

Refugee advocates applaud the law that they regard as a more humanitarian approach toward asylum seekers.

The Senate passed similar amendments on medical evacuations despite ruling party objections on the last day Parliament sat last year.

Australian security agencies warned in December that if those amendments became law, asylum seekers would likely head to Australia again in significant numbers.

The people smuggling boat traffic has all but stopped in the past five years with the government promising that any refugees who arrive on Australian shores by boat will never be allowed to settle there.

Opposition leader Bill Shorten on Tuesday re-drafted the amendments passed by the Senate in December in an attempt to make the law less likely to attract a new wave of asylum seekers, who used to arrive in Australia at a rate of more than a boat a day.

The changes included a provision that only the 1,000 asylum seekers currently held on Nauru and Papua New Guinea and not any future arrivals would be considered for medical evacuation under the new regime.

The government had struck a deal in 2016 for the United States to accept up to 1,250 refugees languishing on Nauru and Papua New Guinea. The government had similarly made the offer only available to refugees on the islands at the time to avoid attracting new asylum seekers, Mr Shorten said.

“I believe that we can keep our borders secure, we can uphold national security but still treat people humanely,” Mr Shorten told Parliament.