President Trump and Iran traded sharp statements Thursday, with Trump amplifying warnings over Tehran’s missile tests and a top adviser to Iran’s leader saying it was not the first time an “inexperienced person has threatened” his country.

The exchanges reflect the Trump administration’s toughening stance on Iran, but also point to wider changes in the White House as it advances a combative and iconoclastic ­foreign policy. The shifts appear to ­sideline traditional diplomacy and concentrate decision-making among a small group of aides who are quickly projecting their new “America first” approach to the world.

Just before the Senate confirmed Trump’s new secretary of state, Rex Tillerson, on Wednesday, national security adviser ­Michael Flynn made a surprise appearance in the White House briefing room to deliver a stern warning to Iran over its most recent ballistic missile test.

“As of today, we are officially putting Iran on notice,” Flynn said.

He accused the previous Obama administration of failing to confront Iran forcefully enough over its “malign actions” and said Trump was changing course.

On Thursday, Trump reiterated his administration’s warning to Iran, writing in a tweet that Tehran was “formally PUT ON NOTICE for firing a ballistic missile.”

Later, Trump told reporters that “nothing is off the table” regarding a possible response to Iran’s missile test, but gave no specifics.

In Tehran, a top adviser to Iran’s supreme leader, Ayatollah Ali Khamenei, fired back, saying that “the American government will understand that threatening Iran is useless,” according to the Reuters news agency, citing local media.

“This is not the first time that an inexperienced person has threatened Iran,” the adviser, Ali Akbar Velayati, said. “Iran does not need permission from any country to defend itself.”

The missile tests are not covered by the nuclear pact, and Iran claims that the launches do not violate other U.N. resolutions because the missiles are not designed to carry nuclear warheads.

Bahram Ghassemi, an Iranian Foreign Ministry spokesman, called Flynn’s comments “baseless, provocative and repetitive.”

Tillerson takes office after a chaotic first dozen days for the Trump administration marked by big swings away from national security and foreign policy stances in place under the Obama administration. The rise of figures such as Flynn and senior counselor Stephen K. Bannon in the White House calls into question whether someone like Tillerson, a former oil company executive who is perceived to be a more mainstream Republican, will wield much influence.

US President Donald Trump speaks during a meeting with leaders of conservative groups to discuss the nomination of Neil Gorsuch to the US Supreme Court in the Roosevelt Room. (Nicholas Kamm/AFP/Getty Images)

Trump campaigned on blowing up business as usual in Washington, apparently including the courtly traditions of U.S. diplomacy. Still, the administration’s tone has surprised allies and government employees who expected the new president to first spend time offering diplomatic niceties.

The severity of an order suspending the country’s refu­gee resettlement program and temporarily banning entry from seven Muslim-majority nations blindsided even Republican supporters in Congress.

Even before the order Friday, Trump’s first days in office were marked by actions and statements that former U.S. officials and some foreign diplomats saw as intentionally confrontational, such as a public spat with the Mexican president and dismissive comments about the European Union.

[No ‘G’day, mate’: On call with Australian prime minister, Trump badgers and brags]

Trump in his inauguration address blasted America’s trade partners and global outlook, and he used his first hosting of a foreign leader to praise Brexit as a stroke for British “sovereignty.” He recounted his own frustrations dealing with the European Union in a real estate deal. “I had a very bad experience,” he said. He called the 28-member body “the consortium.”

In between, his administration floated and then backed off a 20 percent tariff on Mexican goods to pay for his promised border wall. Mexican President Enrique Peña Nieto canceled a planned White House visit in protest, but Trump said the feeling was mutual.

“Unless Mexico is going to treat the United States fairly, with respect, such a meeting would be fruitless, and I want to go a different route,” Trump told Republican senators last week. “I have no choice.”

A day later, he stood beside British Prime Minister Theresa May for an event that is a staple of world leader diplomacy — the cordial and mutually congratulatory joint news conference. Trump largely used the forum to congratulate himself, and he sounded less than zealous about courting other countries.

“We look to have a great relationship with all countries, ideally,” Trump said Friday, as May looked on, a hint of apprehension visible in her smile. “That won’t necessarily happen, unfortunately probably won’t happen with many countries.”

[British lawmakers tell their prime minister: Your groveling in front of Trump is embarrassing]

Trump added that he hoped for “a great relationship with Russia and with China and with all countries, I’m all for that. That would be a tremendous asset.”

He noted that he believes torture tactics work against terrorism — a position anathema to most U.S. allies — but that he would defer to his defense chief, who opposes it.

Tillerson did not attend, since he had not yet won the job at State.

While Tillerson is an un­or­tho­dox choice, the recently retired ExxonMobil chief executive has been generally viewed as one of Trump’s less provocative hires.

Even so, Tillerson drew scant Democratic support with a vote of 56 to 43. Only four members of the Democratic caucus voted in favor of confirmation: Sens. Heidi Heitkamp (D-N.D.), Angus King (I-Maine), Joe Manchin III (D-W.Va.) and Mark R. Warner (D-Va.).

The 64-year-old Texan has no prior government experience. His admirers, however, say he has a vast knowledge of world affairs and geopolitics born of years of international energy exploration and production.

[Trump’s travel ban could make Rex Tillerson’s potential job harder, a former defense secretary says]

He has remained publicly silent about Trump’s controversial immigration order, and it’s not clear whether Tillerson was even given a say over its scope or wording. His absence from the rollout of a policy that significantly affects the country’s place in the world has sown doubts about the State Department’s role in shaping White House decisions.

A group of diplomats lodged a formal complaint against the order Tuesday in the State Department’s “Dissent Channel,” set up during the Vietnam War as a way for diplomats of all ranks to convey disagreement with foreign policy decisions. The communications are typically confidential and may be done anonymously.

“They should either get with the program or they can go,” White House press secretary Sean Spicer said Monday.

He later said diplomats have a right to raise concerns.

One of Tillerson’s chief outside backers, former defense secretary Robert M. Gates, said Sunday that the immigration order is likely to make his friend’s job harder. Gates, a Republican who recommended Tillerson to Trump as a dark-horse candidate, is among a long bipartisan list of foreign policy experts who have argued that actions appearing to target Muslims play into the hands of extremists who claim that the United States is at war with Islam.

Tillerson had said at his confirmation hearing that he does “not support a blanket-type rejection of any particular group of people,” but he did not rule out a registry or database of Muslims. New United Nations Ambassador Nikki Haley went further, rejecting the idea of a ban on Muslim immigration and calling a registry out of the question.

Haley, who like Tillerson has no formal foreign policy experience, had also startled some U.N. diplomats in her first address at the world body Friday.

“You’re going to see a change in the way we do business,” the former South Carolina governor said. “Our goal with the administration is to show value at the U.N., and the way we’ll show value is to show our strength, show our voice, have the backs of our allies and make sure our allies have our back as well.”

“For those who don’t have our back,” she added, “we’re taking names.”

Haley spoke hours before the immigration order was issued.

[As U.S. ambassador to U.N., Nikki Haley would face world’s most intractable conflicts]

The White House also issued a scathing indictment of the United Nations last week, vowing to strip some U.S. funding and condition other money on reform and compliance with U.S. objectives.

Trump is breaking with the practices of both Republican and Democratic administrations by including a political adviser, Bannon, in National Security Council meetings with Cabinet officials.

On Tuesday, European Council President Donald Tusk included “worrying declarations” from Trump among the challenges or threats to the E.U., along with China, Russia and radical ideologies.

“Capitals around the world are anxiously looking at how the new administration starts engaging with friends and foes,” said ­Arturo Sarukhan, a former Mexican ambassador to Washington. “If the U.S. treats a neighbor, partner and ally like Mexico, a nation so relevant to the prosperity and security of the U.S., with ultimatums and bullying, they will probably feel that they themselves may be in for a rough ride.”

A European diplomat who recently met with Trump aides and pressed for cooperation at the United Nations and elsewhere to promote peace in the Middle East recounted a startling exchange with Jason D. Greenblatt, then Trump’s in-house lawyer and now his chief of international negotiations.

“We are business people,” the diplomat quoted Greenblatt as saying. “We are not going to govern this country with diplomatic niceties. We are going to govern it as a business.”

Cunningham reported from Istanbul. Carol Morello and Brian Murphy in Washington contributed to this report.

Read more:

Iran nuclear deal is in the crosshairs and may not survive a Trump administration

Trump redefines the enemy and 15 years of counterterrorism policy

Europe’s threat list includes jihadists, Russia — and Donald Trump