Afghanistan on Monday defended the presence of the nearly 40,000 foreign troops on its soil, rejecting Iranian President Mahmoud Ahmadinejad's statement that they were "occupiers" and should be made to leave.
The hardline leader of neighbouring Iran on Sunday called for the people of the Middle East and Afghanistan to join forces to drive out foreign troops.
"These forces are not occupiers," Afghan foreign ministry spokesman Sultan Ahmad Baheen said.
"The presence of foreign troops in Afghanistan is based on a United Nations Security Council resolution. They are here to prevent Afghanistan becoming a safe haven for terrorists," Baheen said.
"These forces will go back home when this is achieved," the spokesman said. "Iran understands this."
There are nearly 31,000 NATO-led International Security Assistance Force troops in Afghanistan and about 10,000 more foreign soldiers with a separate US-led anti-terror coalition.
The coalition led the offensive that drove out the Taliban in late 2001 and has been here since, battling the movement's insurgents and their Islamist allies, who once allowed Afghanistan to shelter the Al-Qaeda terror network.
The foreign troops are also trying to extend the authority of the government and stabilise areas to allow much-needed reconstruction.