(CNN) Iran vowed Thursday it would not bow to threats from the United States and would continue its missile activity.

A senior adviser to Ayatollah Ali Khamenei, the Iranian supreme leader, criticized the "extremism" of President Donald Trump, who has declared Iran was "on notice" after it test-fired a ballistic missile Sunday.

Following a meeting Thursday with Harley-Davidson executives in the White House, Trump declined to rule out the prospect of military action against the Islamic republic.

"Nothing's off the table," he said.

The tensions between the two countries have been simmering since the election of Trump, a harsh critic of the nuclear deal with lran that the Obama administration brokered. Last week, Trump announced a temporary travel ban on nationals from Iran and six other Muslim-majority countries, barring them from entering the United States.

Trump tweeted Thursday that "Iran has been formally PUT ON NOTICE" and should have been "thankful" for the "terrible deal."

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! — Donald J. Trump (@realDonaldTrump) February 2, 2017

Speaking to reporters Thursday in Tehran, the Iranian adviser, Ali Akbar Velayati, dismissed what he called the US leader's "baseless ranting" and said that even Americans were not satisfied with "Trump's extremism," according to Iran's semiofficial Fars News Agency.

Velayati blasted Trump as lacking sufficient experience, saying he should take lessons from his predecessor, Barack Obama. Those who threaten the Muslim world should take a look at US failures in Afghanistan, Iraq and Syria, he added.

He said that all test-fired missiles were defensive and that Iran did not need to seek permission to carry out such activities.

JUST WATCHED Donald Trump and Iran: The one thing to know Replay More Videos ... MUST WATCH Donald Trump and Iran: The one thing to know 01:36

The Iranian Ministry of Foreign Affairs insisted Tuesday that this week's test was not a violation of the Security Council resolution barring Iran from testing "ballistic missiles designed to be capable of delivering nuclear weapons."

Iran has tested several ballistic missiles since the nuclear agreement was struck in 2015. In March, Iran test-fired two missiles with the words " Israel must be wiped off the Earth " written on them in Hebrew. The United States condemned that launch.

Nuclear deal in danger?

The sudden escalations of US-Iranian tensions have raised concerns about the future of the nuclear accord with Iran, which put stringent limits on the country's nuclear program. It allowed sanctions to be eased and business with Iran to recommence.

Trump has been a longtime critic of the accord, which was brokered after two years of talks with the five members of the Security Council and Germany in 2015.

Flynn on Wednesday did not say whether the United States would take action beyond a verbal warning. Three senior administration officials, speaking on background, said they were still in the early stages of determining what action the United States should take in response.

"We are considering a whole range of options. We're in a deliberative process," one official said.

Nasser Hadian, a professor of international relations at Tehran University, told CNN it was unlikely the Trump administration would tear up the agreement, but it was possible it would impose fresh sanctions on the country.

Abandoning the accord "would serve hard-line interests in Iran," he said.

Trump's travel ban

Iran has vowed "reciprocal measures" to Trump's immigration travel ban, and President Hassan Rouhani on Thursday criticized the executive order as an example of Trump "trampling on all international principles and commitments."

"The basis for this incorrect act is based on incorrect and misplaced discrimination," Rouhani said. "The time is long over for us to want to use walls to distance peoples and nations."