The first refugees accepted under an agreement with Australia are headed to the United States, months after President Donald Trump assailed the deal as “dumb” and not in the country’s best interests.

Fifty-four asylum-seeking refugees left Pacific island camps this week where Australia had housed them for several years. Twenty-five refugees came from an all-male camp in Papua New Guinea’s Manus Island, while the other 27 refugees came from a camp on the island of Nauru, a U.S. State Department official said on Thursday. Some advocacy groups have said the refugees are set to settle in cities from Los Angeles to Atlanta.

The resettlement of the refugees, mostly men from countries such as Iran, Afghanistan, Pakistan, Iraq and Somalia, is part of a deal forged between the United States and Australia under the Obama administration.

Under the agreement, about 1,250 refugees, who have been refused entry to Australia and are housed in offshore detention centers, will be accepted by the U.S. In exchange, Australia will accept Honduran and Salvadoran refugees under a U.S.-led resettlement program from Costa Rica.

Shortly after his inauguration, Trump tweeted he would “study this dumb deal,” raising concerns that he might nix it. And in his first conversation with Australian Prime Minister Malcolm Turnbull, Trump heatedly accused Australia of trying to export the next Boston Marathon bombers to America. “Does anybody know who these people are? Who are they? Where do they come from?” he said, according to transcripts of the call obtained by the Washington Post. “Are they going to become the Boston bomber in five years? Or two years? Who are these people?” Trump added, “We are like a dumping ground for the rest of the world. I have been here for a period of time; I just want this to stop. I look so foolish doing this.”

On Wednesday, the Trump administration announced it will limit refugee admissions to about 45,000 in the coming fiscal year, which is down sharply from the 110,000 cap in President Barack Obama’s last year in office. A State Department official said that total would include the refugees from Australia.

The refugees arriving this week are the collateral damage in Australia’s widely criticized “Stop the Boats” policy, the rule that asylum seekers who try to reach Australia by sea will not “make Australia home,” even if they are genuine refugees, are children or have skills. Many of the asylum seekers have reportedly endured harsh treatment in refugee camps.

Amnesty International and Human Rights Watch published a report last year which found that Australia inflicted suffering on refugees and asylum seekers “in what appears to be a deliberate policy to deter further asylum seekers from arriving in the country by boat.”

kurtis.lee@latimes.com