Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump’s reported rift with Australia's leader over a deal to resettle refugees has shone a spotlight on the country's controversial program which sees thousands of migrants kept offshore on detention islands.

But these places in the Pacific Ocean are not tropical paradises: Amnesty International and Human Rights Watch, along with the U.N. refugee agency UNHCR say conditions on the islands are deplorable.

Asylum-seekers look through a fence at the Manus Island detention center in Papua New Guinea on Mar. 21, 2014. Reuters

In an effort to clamp down on illegal smugglers and to decrease the number of migrant deaths at sea, the government of Prime Minister Malcolm Turnbull won't accept any asylum seekers, migrants or refugees who arrive by boat.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Instead, it intercepts such vessels and sends them to remote Manus Island, in Papua New Guinea, as well as the world’s smallest independent republic, the impoverished island nation of Nauru.

Australia pays Nauru and Papua New Guinea to house the migrants there and then works with UNHCR to find countries that will resettle them.

Rights groups say the camps are "prison-like": hot, overcrowded, unhygienic and dangerous. Human Rights Watch reported that refugees and asylum seekers on both islands faced physical abuse, including sexual assault and rape.

One of the U.N.’s top ranking officials on migrant human rights, Francois Crepeau, said that the conditions on Nauru, were “cruel, inhuman and degrading.”

Almost 2,000 asylum seekers and refugees have ended up in limbo at the two island detention centers, languishing there for years as they wait for the lengthy UNHCR vetting process to complete.

Rights groups also report that conditions are so bad that many asylum seekers and refugees have developed mental health problems as a result of their lengthy captivity there — suicide attempts are frequent as well as cases of self-harm. There have also been multiple instances of refugees setting themselves on fire as a form of protest over Australia’s policies, according to the Associated Press.

Many of the refugees being held come from Iraq and Iran — two of the Muslim-majority nations among the seven countries whose citizens are currently barred from entering the U.S. for at least 90 days under the executive order signed by Trump last week.

Sleeping facilities at the Manus Island Regional Processing Facility, used for the detention of asylum seekers that arrive by boat, on Manus Island, Papua New Guinea seen in a photo from Oct. 2012. Australian Department of Immigration and Citizenship via Getty Images

And they are expensive for Australia to maintain, it costs Australia $400,000 per refugee, per year to house them on the islands, according to a September 2016 report by UNICEF.

In October 2016, Turnbull announced an ever stricter policy aimed at smugglers that bans any refugee who has tried to reach Australia by boat since 2013 from ever coming to Australia.

“They must know that the door to Australia is closed to those who seek to come here by boat with a people smuggler, it is closed,” Turnbull told a press conference on Oct. 30, 2016. "Those passengers will never settle in this country."

Asylum seekers hold up identity documents after landing on Manus Island, Papua New Guinea, on Aug. 2, 2013. Eoin Blackwell / AP

All that said, Australia takes in its fair share of refugees and asylum seekers who enter the country through other means in coordination with the UNHCR. It accepted 13,756 refugees in 2014-2015 (the most recent year statistics were available), according to Australia’s Department of Immigration and Border Protection. Of the refugees and asylum seekers accepted by Australia in 2014-2015, the most came from Iraq and Syria, followed by Myanmar and Afghanistan.

The issue between Trump and Turnbull revolves around the U.S. agreement made by the Obama administration late last year to resettle up to 1,250 asylum seekers being held at the controversial Pacific island camps. Under the terms of the deal, only those who had gone through the rigorous United Nations screening process – that can take as long as 18 to 24 months – and granted refugee status would be eligible to go to the United States.