TEHRAN — President Hassan Rouhani of Iran said on Monday that President Trump’s visit to Saudi Arabia was meaningless theatrics, and he suggested that Iran remained open to dialogue with the United States.
At a news conference in Tehran after his decisive re-election on Friday over a hard-line conservative, Mr. Rouhani said his victory had demonstrated that Iranians wanted more freedoms and interaction with the world.
His remarks amounted to an emphatic denunciation of the Saudi monarchy’s extravagant welcome for Mr. Trump in Riyadh on Saturday and Sunday and their portrayal of Iran as the destabilizing force in the region.
Mr. Rouhani said Iran would continue test-firing missiles despite American warnings, describing Iran’s weapons as defensive.
He also ridiculed the $110 billion arms deal the United States and Saudi Arabia announced during Mr. Trump’s visit, suggesting it was Saudi Arabia’s way of making amends for the Sept. 11 attacks.
Those attacks were plotted by the Saudi-born leader of Al Qaeda at the time, Osama bin Laden, and at least 15 of the plotters were Saudi citizens.
“I do not think the American people are ready to trade the lives they lost in Sept. 11 with billions of dollars gained through weapons sales,” Mr. Rouhani said.
He called Mr. Trump’s meeting with Saudi leaders “just a show” and declared it would not “have any political and practical value.”
Mr. Trump’s visit to Saudi Arabia, his first foreign destination as president, was framed by the ruling Saudi monarchy as a fundamental shift in American policy away from the goal of improved relations with Iran that had been sought by the administration of President Barack Obama.
Guided by Mr. Rouhani and Mr. Obama, Iran and major world powers reached an agreement on a landmark deal in 2015 that relaxed economic sanctions on Iran in exchange for verifiable limits on Iran’s nuclear work.
That agreement alarmed the Saudis, who consider Iran their main rivals for influence in the Middle East. Mr. Trump repeatedly denounced that agreement as a giveaway to Iran, but his administration is still abiding by its terms.
Mr. Rouhani, asked if he had a message for Mr. Trump, appeared to signal that he was still interested in a dialogue despite the increasingly hostile posture taken by the new American president toward Iran.
“Iran and America have gone through lots of ups and downs in the past 39 or 40 years. They have used numerous measures against Iran, all leading to failure,” Mr. Rouhani said. “Americans were only successful in their engagement with the Iranian nation during the nuclear talks.”
He also suggested that the leaders of Iran, like many leaders elsewhere, are still trying to understand Mr. Trump and his policies.
“We are waiting for the government to be well established so we can pass judgment,” Mr. Rouhani said.