Interior Minister spokesman Najib Danish told the Associated Press that the Iraqi diplomats had been rescued. He said it's believed three gunmen participated in the attack.
Afghan security forces battled gunmen near the Iraqi embassy and a nearby police compound on Monday.
According to the message that Press TV posted on Twitter, a reporter from Iran's state television was wounded while covering the attack. The journalist is not the only known casualty. Two Afghan security guards from the embassy were killed in the attack, Press TV reports, citing the Iraqi Ministry of Foreign Affairs.
The Associated Press wrote that the attack could be a reaction to the military advances of the Iraqi army that recaptured the city of Mosul from Daesh earlier in July.
Afghanistan is in a state of political and social turmoil, with government forces fighting the continuing Taliban insurgency. The instability has persisted in the country since the 2001 US-led invasion to defeat the Taliban and al-Qaeda. Recently Afghanistan has seen a rise in attacks against security forces and civilians by the Daesh terrorists and the Taliban.