"The leadership demonstrated by the Iranian government has been exemplary in hosting refugees and keeping borders open," said Sivanka Dhanapala, who heads the UN High Commissioner for Refugees team in Tehran.
"It's a story that's not told often enough." Iran has been sheltering a million registered Afghans for almost four decades, and NGOs estimate there are around two million more living under the radar.
That's the fourth-largest refugee population in the world, the UN says.
If it comes into force, the executive order would have a particularly tough impact on the one million Iranians living and studying in the US, as well as their families.
More From This Section
Foreign NGO workers have noted the irony that Iran is targeted by the ban while it continues to deal with huge numbers who have fled an American-led conflict.
Dhanapala highlighted the 2015 decree by supreme leader Ayatollah Ali Khamenei ordering schools to take in all Afghan children, documented or not - a move that left authorities scrambling to build the equivalent of 15,000 new classrooms.
Officials are well aware that Afghans still face a harsh existence in Iran.
As in many countries, Iranians are less than pleased to be hosting so many poor foreigners, especially when their economy has been battered by years of sanctions and mismanagement.
The result is that Iran does a lot to discourage Afghans from staying, rounding up the undocumented and sending them home.
"Even someone like me, who was born in Iran and has lived here 36 years, is not yet an Iranian citizen and the discrimination I face in my education and work is suffocating," said one Afghan, a relatively well-established professional in Tehran, who asked to remain anonymous.
"I have never seen Afghanistan, except for the bad images on the media and I truly fear returning," he said.
"But for 36 years, I have lived in fear of my residency papers not being renewed and it has made life bitter for us."
Iran has tried to encourage voluntary repatriation, but with a still-raging conflict and moribund economy, only 2,426 went home of their own free will last year - a record-low figure according to the UN.