After a nightmare few months of medical alarms on Nauru, Prime Minister Scott Morrison has signalled a willingness to accept New Zealand’s outstanding resettlement offer in exchange for the Senate passing a lifetime ban on people seeking asylum by boat.

The tentative offer, largely brought about by what Australian Medical Association President Tony Bartone calls “a humanitarian emergency requiring urgent intervention” on Nauru, stalled yesterday when the Coalition rejected a Labor compromise to apply the ban only to refugees sent to New Zealand.

Here’s what we know about the bill, the legal context, and what could be Australia’s largest blanket immigration ban since the White Australia policy.

The original plan

In late 2016, then-prime minister Malcolm Turnbull and Home Affairs Minister Peter Dutton announced plans to change the Migration Act to ban any adult sent to Nauru or Manus Island since July 19, 2013 (the day Kevin Rudd announced his resettlement ban) from ever being settled in Australia, even on a spouse, business or tourist visa.

The Migration Legislation Amendment (Regional Processing Cohort) Bill 2016 was shortly passed by the House of Representatives, creating new “visa bars” for everyone over the age of 18 sent to Manus Island and Nauru since Rudd’s announcement, as well as people who had tried to seek asylum but chose to return home. The ban would not apply to children, or people who had arrived via boat after July 2013 who were not sent to offshore detention.

Following criticism from the United Nations, lawyers and activist groups that a migration ban would contravene discriminatory prohibitions in the Refugee Convention and possibly be unconstitutional, Opposition Leader Bill Shorten rejected the bill, calling it a move to appease the “extreme right-wing of Australian political opinion”.

The bill was also opposed by the Greens and some crucial Senate crossbenchers, and over the next seven months just kind of fell off the government’s agenda. Then-senator Nick Xenophon even confirmed to Fairfax Media he was prepared to negotiate but had not been approached by the government.

The current push

Since failing to get the lifetime ban bill through, the Coalition has organised the America resettlement deal (subject to Trump’s similar ban on Iranian and Somali refugees), continued to reject New Zealand’s 2013 offer to resettle 150 offshore detainees per year, and presided over an unprecedented level of child and adult trauma in offshore detention.

After being ejected by the Nauruan government last month, Médecins Sans Frontières (Doctors Without Borders) offered harrowing recollections of systemic mental illnesses, child suicide attempts, and “resignation syndrome”, where children withdraw from food, water, speaking and leaving bed, resulting in at least one case of organ failure. MSF’s calls to evacuate detainees has been echoed by the Australian Medical Association, the International Committee for the Red Cross, the UNHCR, the Greens and crossbenchers pushing a new evacuation bill, and even three Liberal MPs last week.

Since then, Morrison has indicated (but not definitively stated) that he could accept New Zealand’s offer in exchange for the original lifetime ban, a bargain reminiscent of his 2014 trade for expanded immigration powers in return for children out of on-shore detention.

While Shorten maintains the ban is not necessary, Labor announced yesterday that it was prepared to accept the deal under three conditions: the Coalition accept New Zealand’s offer and guarantee children and families are evacuated from Nauru; the ban only apply to the cohort sent to New Zealand; and the legislation’s application is limited to the Special Category Visa (subclass 444) enabling open travel of New Zealand citizens, which would they argue result in a similar agreement with the US cohort.

This was shot down by Morrison yesterday, who, in an odd turn of phrase for a government literally bargaining with human lives, announced “you don’t horse-trade on border protection”.

Where are we now?

Crucially, the government’s bill would still apply to those who sought asylum by boat post-2013, including not just the remaining 1300 Manus Island and Nauru detainees but refugees resettled in the United States, people either forcibly or voluntarily returned to their country of origin, and people brought to Australia or Taiwan for medical treatment.

According to Jane McAdam, director of the UNSW Kaldor Centre for International Refugee Law, even under Labor’s amendments, the New Zealand ban would be in breach of the existing Trans-Tasman agreement, basic principles of non-discrimination, and, in banning family reunions in Australia, disrupt the “fundamental legal principle of family unity”.

The plan to create two-tiers of New Zealand citizenship has also been criticised by New Zealand’s Foreign Minister Winston Peters, who announced last week the government would have to revisit the offer “if we end up with people who are second-class citizens in New Zealand”.

There’s also the fact the government’s current commitment to turnbacks means the New Zealand “loophole” argument is basically moot, and that, as Dutton admitted in estimates, current flagging technologies mean there is no operational need for a legislated ban.

Still, it should be noted that, with the exception of family reunions, a number of detainees would be perfectly happy to live in New Zealand and voluntarily never come to Australia. Which, considering what we’ve put them through, seems more than fair.