The attack came amid new uncertainties over the start of talks between the Taliban and the Kabul government.
According to the SITE Intelligence Group, which tracks militant groups’ online activity, in a “communique” IS claimed credit for the firing of 16 mortar shells, which targeted the presidential palace, embassies and Afghan government offices.
The Interior Ministry’s spokesman Tariq Arian said a total of 14 mortar shells were fired from two vehicles in the northern and eastern part of the Afghan capital.
“Most of the mortar shells hit residential houses,” Mr Arian said, adding that an investigation is underway.
According to eyewitnesses, at least one mortar shell landed in the upscale Wazir Akbar Khan neighbourhood, where diplomats and senior government officials reside.
Also on Tuesday, Afghanistan’s intelligence agency said it killed the IS chief justice Abdullah Orakzai in a “complex and targeted operation,” without elaborating.
The statement said Mr Orakzai had orchestrated a prison break earlier this month in eastern Nangarhar province that killed at least 39 people.
Nearly 400 IS militants escaped in the first hours of the attack.
The mortar attack in Kabul came a day after the government said it would not release the last 320 Taliban prisoners it holds until the insurgents free more captured Afghan soldiers.
The decision went against that of a traditional Afghan council held earlier this month – the Loya Jirga – and is likely to further delay intra-Afghan peace talks sought by the United States.
Taliban spokesman Zabihullah Mujahid said he was not aware of the mortar attack in Kabul.
The Islamic State group’s affiliate, which operates in Afghanistan, has interrupted national celebrations in the past with rocket fire.
Also on Tuesday morning, Afghan President Ashraf Ghani attended an Independence Day ceremony at the Defence Ministry in Kabul, inspecting an honour guard and laying flowers on the Independence Minaret monument there.