Asylum seekers at the Oscar compound in the Manus Island detention center, Papua New Guinea. (Eoin Blackwell/European Pressphoto Agency)

Last night, President Trump went off on Australia, criticizing a "dumb" Obama-era "deal" that would, in Trump's words, force the United States to take "thousands of illegal immigrants from Australia."

Except  that's not really what the deal says. Not at all.

Trump is referring to a deal signed in November. According to the agreement, which took months of negotiation, America would accept about 1,200 refugees (not, as Trump called them, "illegal immigrants") from Australia. The United States would prioritize families and children, and all candidates would be subjected to a thorough vetting process. America's Department of Homeland Security would conduct two rounds of interviews with each candidate.

In November, officials estimated that it would take six months to a year to complete the transfer of refugees.

The measure was necessary because of Australia's draconian immigration policies. Asylum seekers who reach the country by boat are never settled in Australia proper. Instead, they're sent to Nauru or Papua New Guinea’s Manus Island for "offshore processing." Right now, there are about 2,000 people between the two islands, including many children. The vast majority come from Iran, Afghanistan and Iraq. Many were transported to Australia by smugglers across a treacherous sea route hundreds of miles long. (At least 1,200 people have died trying to make the trip, one study found.)

After arrival, the migrants are thoroughly vetted; about 80 percent of those people are legitimate refugees, according to the Australian government. And most have been at a camp for more than a year, living in an immigration limbo. They are unable to leave their camps but also forbidden from settling for good.

Critics say that this amounts to indefinite and illegal detention; several reports have documented widespread abuse and mistreatment. Last year, a U.N. committee report found multiple cases of "attempted suicide, self-immolation, acts of self-harm and depression" among children who had lived in prolonged "detention-like conditions."

According to the Guardian, "Peter Young, the former chief psychiatrist responsible for the care of asylum seekers in detention on Manus and Nauru, described the camps as 'inherently toxic' and said the immigration department deliberately harmed vulnerable detainees in a process 'akin to torture.' " Viktoria Vibhakar, a former aid worker for Save the Children Australia, told NPR that conditions were atrocious and that many refugees were suicidal. She also documented cases of sexual abuse committed by workers against children. "I felt like my job was just convincing people to stay alive," she said.

Despite these reports, the Australian government has remained resolutely unwilling to resettle refugees in Australia. Prime Minister Malcolm Turnbull campaigned in 2013 on a vow to "stop the boats." His posters bore slogans like, "No Way: You will not make Australia home." Instead, his government looked to other countries willing to accept the refugees. And they didn't have much luck until the United States stepped in. America has already begun their own vetting on the refugees that they will resettle. Several told CNN that they had already had one round of interviews with American officials.

As the Telegraph reported:

It has never been clear whether Australia offered anything in return for Washington’s concession. There has been speculation that Australia could take asylum seekers  who arrive in the US, or that Canberra may have volunteered to send extra troops to Iraq or to conduct a freedom of navigation exercise patrol near Chinese-claimed territories in the South China Sea.

Others suggested that Australia, which already hosts American troops and has followed the US into each of its wars since Second World War,  offered nothing as part of the deal – and that it was this element which infuriated Mr Trump.

But the arrangement was thrown into chaos last week when Trump signed an executive order that temporarily banned all refugees and visa-holders from several countries, including Iran, Iraq and Somalia. More than two-thirds of the refugees in question come from one of the banned countries. On a call with Australia, Trump described the refugee agreement as "the worst deal ever" and accused Turnbull of seeking to export the "next Boston bombers." He later tweeted that he would "study the deal."

Yet Turnbull has said that Trump pledged to honor the United States commitment, as did officials at State. But some wonder whether he'll "honor" the deal but accept none of the refugees from the seven countries he's targeted.

Read more:

‘This was the worst call by far’: Trump badgered, bragged and abruptly ended phone call with Australian leader

Why Trump’s rebuke could be good for Australia’s prime minister