Iranian President Hassan Rouhani said on Saturday it was no time to build walls between nations and criticised steps towards cancelling world trade agreements, without naming new US President Donald Trump.
His remarks came after Trump ordered the construction of a wall along the US-Mexico border and imposed tough new controls on travellers from seven Muslim countries, including Iran.
"They have forgotten that the Berlin Wall collapsed many years ago. Even if there are walls between nations, they must be removed," Rouhani said at a tourism convention in Tehran.
Rouhani did not comment directly on the visa ban, but said Iran had "opened its doors" to foreign tourists since the signing of a nuclear agreement with world powers in 2015.
With more than a million Iranians living in the US, many families are deeply concerned about the implications of Trump's visa ban, which also affects citizens from Iraq, Libya, Somalia, Sudan, Syria and Yemen.
"To annul world trade accords does not help their economy and does not serve the development and blooming of the world economy," Rouhani said at the conference. "This is the day for the world to get closer through trade."
Earlier, Taraneh Alidoosti, one of Iran's most popular actresses said that she would boycott February's Academy Awards in protest at the visa ban.
"Trump's visa ban for Iranians is racist. Whether this will include a cultural event or not, I won't attend the #AcademyAwards 2017," tweeted Alidoosti, who stars in the Oscar-nominated movie "The Salesman".
No visas will be issued for migrants, refugees or visitors from the seven countries for at least 90 days, a restriction which can be extended if the countries in question do not provide extensive information on individuals seeking to enter the United States.
Trump also suspended the US refugee programme for 120 days, and specifically barred Syrian refugees until further notice.