A suicide attack targeting a Shiite cultural center in Afghanistan's capital Kabul is said to have killed at least 40 people. A neighboring news agency, Afghan Voice, was also hit, prompting fears about the safety of media organizations and journalists in the country ravaged by militants.

The Islamic State militant group claimed responsibility for the attack, according to an online statement by the group’s Amaq news agency.

Local news agencies reported that many other civilians were injured at the blast site and around 17 media representatives were injured.

Nasrat Rahimi, deputy spokesman for the Minister of Interior, told Pajhwok Afghan News the explosion took place at 10:30 a.m. local time (1:00 a.m. EST). According to the ministry, preliminary reports indicated that the attack was triggered by a suicide bomber.

The IS group statement said the attack was carried out by one bomber wearing a vest and followed three other bomb blasts in the same area.

A journalist at Afghan Voice, Sayed Abbas Hussaini, said there appeared to have been more than one explosion during the attack. An initial blast at the entrance to the compound housing the two offices was followed by two more explosions inside the offices. He added that one reporter at the agency had been killed and two injured.

The attack, which was a latest to have hit media organizations in Kabul, occurred during panel discussion on the 38th anniversary of the Soviet invasion of Sunni-majority Afghanistan at the Tabian Social and Cultural Centre.

President Ashraf Ghani’s spokesman issued a statement calling the attack an “unpardonable” crime against humanity and pledging to destroy terrorist groups, Reuters reported.

Meanwhile, the apparent attack on a media organization also prompted outrage in many like Mujib Khilwatgar, CEO of the Nai, a media advocacy group, who told Pajhwok New that the Afghan Voice news agency was the target of the attack.

Afghan Journalist Safety Committee (AJSC), a watchdog to promote safety of journalists in the country, condemned the attack on Twitter.

The incident follows an attack on a private television station in Kabul last month. Before Thursday’s attack, two journalists and five media assistants were killed doing their jobs this year in the country, according to a report this month by Reporters Without Borders, an organization that works to protect freedom of press. The country is ranked 120 out of 180 on the organization’s Press Freedom Index.

2016 was described as one of the deadliest for journalists in Afghanistan, with the war by the Taliban being the main source of violence. “By sowing terror, the Taliban and Islamic State have created information “black holes” in many regions since 2015. Afghanistan struggles to protect its journalists in this increasingly violent civil war,” a note on the website said.

The organization, however, said that Afghanistan’s constitution guaranteed freedom of information and stated it was the only country in the world to have created “committees for the safety of journalists” with representatives of the state and journalists’ associations. “But many governors and local officials are unable to accept the principle of media independence, and the police and military are implicated in several cases of violence against journalists,” the note read.

A report issued by the AJSC in July reported different figures from that of Reporters Without Borders and said in the first six months of 2017, 10 journalists were killed and 73 cases of violence had been reported including "killing, beating, inflicting injury and humiliation, intimidation, and detention.” The numbers marked a 35 percent increase over the same period last year.

It also said that at least 13 journalists and media personnel were killed last year while the number was four in 2015.

Over the years, several international media watchdogs have condemned the freedom and impunity given to the militants and other extremists to conduct such attacks against journalists.