Prime Minister Malcolm Turnbull of Australia said that despite the bluntness of the discussion with President Trump, the United States had committed to upholding the arrangement to accept 1,250 refugees from an Australian detention center.CreditCreditMick Tsikas/European Pressphoto Agency

WASHINGTON — A phone call between President Trump and the Australian prime minister is threatening to develop into a diplomatic rift between two stalwart allies after the two men exchanged harsh words over refugee policy, and Mr. Trump abruptly ended the call.

The phone call last Saturday between Mr. Trump and Prime Minister Malcolm Turnbull turned contentious after the Australian leader pressed the president to honor an agreement to accept 1,250 refugees from an Australian detention center.

Late Wednesday night, Mr. Trump reiterated his anger over the agreement on Twitter. He called the agreement a “dumb deal” and blamed the Obama administration for accepting it but then said that he would “study” it. The tweet was posted after The Washington Post reported details of the phone call.

Do you believe it? The Obama Administration agreed to take thousands of illegal immigrants from Australia. Why? I will study this dumb deal!

The leaders of the two allies did not seem to agree on the outcome of the conversation. Mr. Trump’s tweet suggested the agreement could be at risk while Mr. Turnbull said that, despite the bluntness of the discussion, the United States had committed to upholding the arrangement.

The flare-up — and conflicting characterizations of the call from Mr. Trump and Mr. Turnbull — threatened to do lasting damage to relations between the two countries and could drive Canberra closer to China, which has a robust trading relationship with Australia and is competing with Washington to become the dominant force in the Asia-Pacific region.

A senior Trump administration official said the president told Mr. Turnbull on Saturday that the refugees could include the “next Boston bombers.” He also said he was “going to get killed” politically by the deal, given that the day before he signed an executive order to stem the refugee flow into the United States and refuse visas for all citizens from seven Muslim countries.

The Trump administration official said the call was shorter than planned, and ended abruptly after Mr. Turnbull told the president it was necessary for the refugees to be accepted.

The details of the call were confirmed by a senior administration official with direct knowledge of the exchange who spoke on condition of anonymity because he was not authorized to publicly discuss the diplomatic talks.

Mr. Turnbull, speaking Thursday at a press briefing in Australia’s southern state of Victoria, refused to comment at length on the telephone call, or say whether it had ended sooner than expected. But he did acknowledge that it had been candid.

“I’ve seen that report,” Mr. Turnbull said of the Washington Post account, “and I’m not going to comment on the conversation, other than to say that in the course of the conversation, as you know and as was confirmed by the president’s official spokesman in the White House, the president assured me that he would continue with, honor the agreement we entered into with the Obama administration with respect to refugee resettlement.”

Video

President Trump has questioned a deal to bring migrants held by Australia into the United States as refugees. Here is what daily life looks like for one of them.CreditCreditAshley Gilbertson for The New York Times

Pressed about Mr. Trump’s tone, and whether the president ended the call by hanging up, Mr. Turnbull refused to comment. “It’s better that these things, these conversations are conducted candidly, frankly, privately,” he said.

Mr. Turnbull again stated that Australia’s relationship with the United States remained robust, but if the deal to resettle the refugees falls through, Canberra will be left with a seemingly intractable political problem at home.

The Australian government has a policy that bars any refugees who attempted to arrive by boat from ever setting foot in the country. The majority of the refugees being held on the Pacific islands of Nauru and Manus are from Iran and Iraq. Both are Muslim-majority nations that are among the seven countries — including Libya, Somalia, Sudan, Syria and Yemen — whose citizens are barred from entering the United States for at least 90 days under an executive order signed by Mr. Trump last week.

“I can assure you the relationship is very strong,” Mr. Turnbull said. “The fact that we received the assurance that we did, the fact that it was confirmed, the very extensive engagement we have with the new administration underlines the closeness of the alliance.”

“But as Australians know me very well — I stand up for Australia in every forum — public or private.”

Bill Shorten, the leader of Australia’s opposition Labor Party, said there were two versions of the conversation between Mr. Turnbull and Mr. Trump over the refugee deal, and Mr. Turnbull should be “straight with the Australian people.”

Mr. Turnbull “made it clear he had a constructive discussion” over the refugee deal, Mr. Shorten said. “But now it appears another, different version of the same conversation has emerged.”

Kim Beazley, a former Australian ambassador to the United States who served in Washington during much of the Obama administration, said the impact of the flare-up would be “minimal” if the refugee deal remained in force. But he added, “If the tonality is true you wouldn’t want to have too many conversations like that.”

It was not the only awkward call last week between Mr. Trump and a world leader. Earlier, on Friday, Mr. Trump joked to President Enrique Peña Nieto of Mexico that he would deploy troops to Mexico if the Mexican government failed to control “bad hombres down there.”

On Wednesday night, the senior Trump administration official said the president’s comments to Mr. Peña Nieto were made in jest and the comments reflected Mr. Trump’s standing offer to help Mexico battle drug gangs and control border crossings. The official said the conversation between the two presidents was friendly, and Mr. Peña Nieto did not appear to be offended.

The Mexican government issued a statement denying the A.P. report and said it did not “correspond to reality.”