The war of words with Iran came just hours after news had emerged of a combative phone call that took place on Saturday between Mr. Trump and Australia’s prime minister, Malcolm Turnbull, when Mr. Turnbull pressed the president to honor an American agreement to accept 1,250 refugees from an Australian detention center.
On Thursday morning, Mr. Trump told an audience at the National Prayer Breakfast, “When you hear about the tough phone calls I’m having, don’t worry about it.” He added: “We have to be tough. It’s time we’re going to be tough, folks. We’re taken advantage of by every nation in the world, virtually. It’s not going to happen anymore.”
But the administration tried to contain the fallout from the disagreement with Australia.
The White House press secretary, Sean Spicer, said Mr. Trump would not block the transfer, provided the migrants are subjected to “extreme vetting,” even though he was “extremely upset” by the agreement.
“The president is unbelievably disappointed in the previous administration about the deal that was made,” Mr. Spicer said. But he added that Mr. Trump has “the ultimate respect for the prime minister and the Australian people.” And he contradicted news reports and previous characterizations by White House staff members that the call with Mr. Turnbull was combative.
The president himself waded into the issue later during comments at the White House, emphasizing that he would honor the Obama-era refugee agreement with Australia, if grudgingly.
“I love Australia as a country,” Mr. Trump said, according to a press pool report. “But for whatever reason, President Obama said we’d take probably well over 1,000 illegal immigrants who were in prisons and take them into this country, and I just said, ‘Why?’”
Mr. Trump said he would honor the agreement, noting that when a “previous administration does something you have to respect that, but you can also say why are we doing this.”
There was no dispute over the growing tensions between Washington and Tehran.
In an early morning Twitter post on Thursday, Mr. Trump said, “Iran has been formally PUT ON NOTICE for firing a ballistic missile. Should have been thankful for the terrible deal the U.S. made with them!”
In a second post, he said, “Iran was on its last legs and ready to collapse until the U.S. came along and gave it a life-line in the form of the Iran deal: $150 billion.”
Hours later, the Iranian supreme leader’s top adviser, Ali Akbar Velayati, responded forcefully, saying, “This is not the first time that an inexperienced person has threatened Iran,” according to the semiofficial news agency Fars. “The American government will understand that threatening Iran is useless.”
A spokesman for the Iranian Foreign Ministry condemned Mr. Flynn’s comments about the missile test as “repetitive, baseless and provocative.” The spokesman, Bahram Ghasemi, even appeared to mock the language in the national security adviser’s statement.
“Instead of thanking Iran for its continued fight against terrorism,” he said, “the American government is practically helping the terrorists by claims about Iran that are baseless, repetitive and provocative.”
In the statement issued by Mr. Flynn on Wednesday, he said, “Instead of being grateful to the United States for these agreements, Iran is now feeling emboldened.”
Administration officials said they were considering a range of options if Iran defies the United States, but they have refused to detail them. Although Mr. Trump and Mr. Flynn both invoked the nuclear deal, the White House has been careful to distinguish Iran’s behavior in the region, which it condemns as destabilizing, from Iran’s adherence to the nuclear agreement. Iran’s missile tests would be judged through a separate United Nations Security Council resolution.
While Mr. Trump threatened during the campaign to rip up the deal, he has not repeated that threat since taking office. And administration officials have signaled that their focus is more on constraining Iran’s support of militant proxies in Yemen, Lebanon and elsewhere.