The UN refugee agency and the governments of Iran and Afghanistan have signed an agreement to help repatriate Afghan refugees in Iran over the next two years.
By Sanjoy Majumder
BBC correspondent in Kabul
The deal allows for the gradual return of some one million Afghans still living in Iran after fleeing fighting in their own country.
Afghanistan is keen to control the numbers of those who return to avoid putting too much pressure on its fragile economy.
Many refugees are reluctant to go home
Monday's agreement signed in the Iranian capital, Tehran, is a follow-up to one signed in Geneva last year.
It allows for the orderly return home of Afghan refugees living in Iran to ensure that they can be properly rehabilitated.
A similar agreement has been signed with Pakistan, which also has large numbers of Afghan refugees.
The UN refugee agency (UNHCR) is keen on monitoring the return of the refugees, and especially wants to ensure they are properly informed of conditions back home so that they are able to sustain themselves economically.
The agency says nearly half a million refugees have returned from Iran over the past year.
An estimated one million Afghans are still living there, many in very poor conditions, and Iran is keen on seeing them go home.
But many of those who have returned to Afghanistan have found conditions there equally difficult, with no housing or jobs, and growing insecurity, particularly in the south and the east.
But the UNHCR says it is committed to continue assisting those Afghans who want to return and hopes to spread out the repatriation process over two years so as not to overwhelm Afghanistan's economy.