Brigadier General Amir Hatami made the remarks in a telephone conversation with his Afghan counterpart, Tariq Shah Bahrami, on Sunday.
Hatami offered condolences to the Afghan people, government and armed forces over multiple terrorist attacks that killed and injured many people in the country in recent days, Press TV reported.
"Iran has always been concerned about conspiracies hatched by outsiders against the Afghan people and has for many years done its best to ameliorate the suffering of the oppressed people of Afghanistan," he added.
The Iranian defense minister also stressed that the US created Daesh to use it in Syria and Iraq.
However, he said, "After heavy blows suffered in these two countries, the US tried to take Daesh out of the scene and transfer it to Afghanistan to justify its presence there through [the group's] shameless crimes."
Late last month, Leader of the Islamic Revolution Ayatollah Seyyed Ali Khamenei issued a similar warning about Washington's attempt to relocate Daesh from the Middle East to Afghanistan.
During Sunday's phone call, the Afghan defense minister, for his part, appreciated the expression of sympathy with his countrymen by Ayatollah Khamenei as well as the Iranian nation, government and armed forces.
He further hailed cordial relations between Tehran and Kabul throughout the history.
Iran and Afghanistan and other neighboring countries should not disregard their common enemy and should instead cooperate closely with each other in the fight against terrorism, he said.
The US and its allies invaded Afghanistan under the guise of the war on terror. Some 17 years on, the local Taliban militant group has only boosted its campaign of violence across the country, targeting both civilians and security forces in bloody assaults.
More recently, Daesh has also taken advantage of the chaos and established a foothold in eastern and northern Afghanistan. The Takfiri outfit has also stepped up its terror attacks in the war-torn country despite the presence of thousands of foreign troops there.