Daesh claims responsibility for the attack, the group's news agency Amaq says, without providing evidence.
Daesh has claimed responsibility for an attack on a television station in Kabul, in which gunmen disguised as police killed a security guard and opened fire on staff in the latest assault on media workers in Afghanistan.
Afghan special forces suppressed the attack against Shamshad TV, a private Pashto-language broadcaster based near the national stadium, after about two hours, but police said at least two people were killed and 20 wounded.
"People dressed in police clothes came in and initially threw hand grenades, which killed one of our guards and wounded another," Abed Ehsas, Shamshad's news director told broadcaster Tolo News TV.
"After that, others got into our building and started firing. Some of our colleagues were hit, though, thank God, many others managed to get out. Some were wounded by gunshots, falling glass and when they jumped from high floors."
During the attack, a special forces unit blasted a hole in the concrete wall around the compound and entered the site amid gunfire. At least one attacker was killed during the operation, while another was killed at the compound entrance.
Witnesses heard gunshots inside the building every few minutes as security forces swarmed the area, helping several employees escape the compound.
Interior Ministry spokesman Najib Danish said as many as three attackers were involved in the assault.
Taliban not involved
Daesh claimed responsibility for the attack, the group's news agency Amaq said on Tuesday, but has not yet provided any evidence.
Initially, the Taliban was considered the prime suspect, but it denied involvement in a Twitter statement.
Kabul has been rocked by a series of deadly attacks in recent weeks, as the Taliban and Daesh step up offensives against security installations and mosques.
Violence against Afghan journalists surged in the first half of 2017, a media watchdog said in July.
Last year, the country suffered its deadliest year on record for journalists, according to the Afghan Journalists Safety Committee (AJSC), with at least 13 media workers killed – 10 of them by the Taliban. That made it the second most dangerous place for reporters in the world after Syria.
In January of last year, seven employees of popular TV channel Tolo, which is often critical of the insurgents, were killed in a Taliban suicide bombing in Kabul, in what the militant group said was revenge for "spreading propaganda" against them.
It was the first major attack on an Afghan media organisation since the Taliban were ousted from power in 2001, and it highlights the dangers faced by media workers in Afghanistan.
Security in Kabul has been ramped up since a May 31 truck bomb exploded on the edge of the so-called Green Zone, killing around 150 people and wounding 400 others.
That attack also caused extensive damage to 1TV, a private news channel located close to the bombing site. In an act of defiance, the news channel managed to resume operations within a few hours.
Special truck scanners, barriers and permanent and mobile checkpoints have been rolled out across the city since the May bombing.
But a suicide bomber struck again in Kabul's heavily fortified diplomatic quarter last week, killing at least five people, showing that militants can still hit the heart of the city despite tighter security.