"Members of the parliament authorised the government to grant Iranian citizenship to the wife, children and parents of foreign martyrs who died on a mission... during the Iran-Iraq war (1980-1988) and afterwards," it said.
Special report: The future of Pakistan-Iran relations
Citizenship must be awarded "within a maximum period of one year after the request", IRNA added.
Iran's outgoing conservative-dominated parliament will serve until late May.
No figures are available on the number of foreign fighters killed during the Iran-Iraq war, but Afghans, and even a group of Iraqis, fought alongside Iranian forces against the regime of Saddam Hussein.
The law could apply to "volunteers" from Afghanistan and Pakistan who are fighting in Syria and Iraq against militants including the Islamic State group and al-Nusra Front.
Shia Iran is a staunch supporter of Syrian President Bashar al-Assad and provides financial and military support to his regime.
India, Iran discuss undersea gas pipeline bypassing Pakistan
Tehran says its Fatemiyoun Brigade, comprised of Afghan recruits, are volunteers defending sacred Shia sites in Syria and Iraq against Sunni extremists like those of IS.
The Islamic republic denies having any boots on the ground and insists its commanders and generals act as "military advisers" in Syria and Iraq.
Iranian media regularly report on the death of Afghan and Pakistani volunteers in Syria and Iraq, whose bodies are buried in Iran. More than three million Afghans live in Iran, one million as legal migrants.
COMMENTS (9)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ