Interior Minister Spokesman Najib Danish told the AP that the Iraqi diplomats were safe and had been rescued.
Two police officials speaking on condition of anonymity said that a car bomb exploded outside the embassy, following which gunmen attempted to enter the building, which is located in the centre of Kabul.
It is believed that three gunmen are involved in the attack, added the interior ministry spokesman.
A security source told AFP that a suicide bomber had blown himself up in front of the Iraqi embassy. Civilians are being evacuated from the area as the attack is ongoing, said the official, who declined to be named.
At least four explosions, along with the sounds of gunfire and grenades, were heard by AFP reporters and residents near the city’s diplomatic quarter shortly after 11:00 am.
A column of smoke rose into the air from the blast site, as the area was surrounded by armoured vehicles and a large contingent of police and Afghan soldiers.
A police officer in the area, who identified himself only as Abdullah, said the gunfire was initially intense but was now sporadic.
At least one eyewitness, a store owner who goes by the name of Hafizullah, said that he saw the bodies of two policemen on the ground before armoured personnel carriers and police arrived to cordon off the area.
“The explosion was so strong. I was so afraid,” said Maryam, a woman crying near the site of the attack said. She said she works at the nearby office of Afghanistan’s National Airline Ariana.
The Iraq Embassy is located in a part of the city known as Shahr-e-Now, which lies outside the “green zone” where most foreign embassies and diplomatic missions are located.
The area is heavily fortified with a phalanx of guards and giant cement blast walls. By comparison, the Iraqi Embassy is located on a small street in a neighborhood dominated by markets and businesses.
The militant Islamic State (IS) group claimed responsibility for the attack via its Amaq news agency, saying that two IS terrorists had attacked the embassy. The claim has not been verified as yet.
The attack is the latest to rock Kabul, and comes as the resurgent Taliban intensify their offensive across the country.
A week ago, a car bomb struck the city during morning rush hour, killing at least 26 people in an attack claimed by the Taliban.
But IS, recently ousted from the Iraqi city of Mosul, have been expanding their footprint in eastern Afghanistan and claimed responsibility for several devastating attacks in Kabul.
A recent United Nations report showed that nearly 20 per cent of all civilian deaths in Afghanistan in the first half of 2017 took place in Kabul.
Many of those deaths occurred in a single attack in late May when a truck bomb exploded during the morning rush hour, killing more than 150 people and injuring hundreds.
No group has officially claimed responsibility for that attack, the deadliest in the capital since the United States (US) invasion in 2001.
Nato forces ended their combat mission in Afghanistan at the end of 2014.
Since then Afghan troops and police, beset by soaring casualties, have struggled to beat back the insurgents.
The US is considering whether to send thousands more troops to help the beleaguered Afghan forces as the war-weary country is gripped by increasing insecurity.