Najib Danish, a spokesman for Afghanistan’s Interior Ministry, told CNN a suicide bomber blew up the gates at about 11:30 a.m.
Three gunmen entered the embassy’s grounds and began firing.
Danish said Afghan special forces were called in to engage the attackers, killing all of them after a battle lasting more than four hours.
Iraqi diplomats were taken to a safe place, Danish said, and none of them were injured. The only injury was a member of Afghan’s police force.
Monday’s gunbattle is just the latest attack in Kabul in recent months, after two deadly bombings in May and July left almost 200 people dead.