"Iran's consulate in Herat is closed until further notice," an informed source in the ministry was quoted as saying.
The measure came after an anti-Iran protest in front of the Iranian consulate in the western Afghan city on Sunday turned violent and was ultimately confronted by police firing warning shots.
Some 200 Afghans threw rocks and broke consulate windows to protest the alleged killing of 13 Afghan immigrants three months ago by Iranian security forces while trying to illegally cross into Iran.
"Iran has asked Afghan authorities to provide an explanation for the attack on the consulate and to take measures to prevent it from happening again," said the source at the Iranian foreign ministry.
The source added that Kabul was "responsible for the safety of diplomatic buildings, in particular Iran's consulate in Herat."
The source also denied as "false and baseless" reports of killing of Afghan immigrants by Iranian border forces.
A consulate official said Sunday that Tehran and Kabul had cooperated in investigating the alleged incident, but the inquiry gathered to "no proof" that Afghan immigrants had entered the country, legally or illegally, or that they were killed in Iran.
About 2.4 million Afghans -- refugees and illegal immigrants -- live in Iran, many of whom moved after the 1979 Soviet invasion of Afghanistan. Many Afghans attempt to enter Iran on a daily basis in the hopes of finding work.
Crossing the border with the help of local human traffickers, Afghan migrants sometimes end up being jailed by Iranian border guards.