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 on Saturday 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, among them 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 Tehran conference. "This is the day for the world to get closer through trade."

The protectionist-minded Trump formally withdrew the United States from the Trans-Pacific Partnership trade deal on Monday, fulfilling a campaign pledge to end American involvement in the 2015 pact.

'Not logical'

On Thursday, one of Iran's most popular actresses said she would boycott next month's Academy Awards in protest at the ban.

READ MORE: Taraneh Alidoosti boycotting Oscars over Trump 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 Taraneh Alidoosti, who stars in the Oscar-nominated "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.

Quizzed on the street, many Iranians said they were baffled by the move.

"Americans themselves are mostly immigrants. To pick out a few countries and call them terrorist is not logical," Mohsen Najari, a 33-year-old resident of the Iranian capital, told the AFP news agency.

READ MORE: Donald Trump's #MuslimBan sparks outrage and fear

Tehran and Washington have not had diplomatic ties since students stormed the US embassy in 1980 following an Islamic revolution that toppled the US-backed shah.

"It's got nothing to do with terrorism. Iran and the US just don't have good ties. The US has good relations with Saudi Arabia so it doesn't matter how many terrorists come from Saudi Arabia," said Sima, a 27-year-old.

Trump also suspended the US refugee programme for 120 days, and specifically barred Syrian refugees until further notice.