The Iranian Foreign Ministry and the country's Supreme National Security Council (SNSC) have condemned an attack that left dozens dead in a remote Shia village in northern Afghanistan.

Dozens of civilians, including women and children, were massacred during an attack on Mirza Olang village in the northern Sar-e Pol Province overnight Sunday. A number of Afghan security forces were also among the dead.

Taliban claimed responsibility for the attack,but its spokesman, Qari Yusouf Ahmadi, denied killing civilians in the village, cooperating with Daesh, or using foreign assailants.

Iranian Foreign Ministry Spokesman Bahram Qassemi on Wednesday condemned the attack as “brutal and inhumane” and offered his condolences to the Afghan government and nation as well as the victims' families.

Qassemi referred to the long-standing grudge and hostility of the ill-wishing enemies of Afghanistan, and urged the Afghan government and people to remain vigilant and maintain unity in the face of such tragedies and divisive measures by terrorist groups.

Also on Wednesday, SNSC Secretary Ali Shamkhani, in a message to his Afghan counterpart, condemned the attack and called for a collective battle against terrorism.

Shamkhani said that “only serious resolve and determination, cooperation among neighboring countries and a genuine fight against terrorism” would put an end to such “poignant measures by extremist groups and those affiliated with Takfiri ideologies.”

The Islamic Republic of Iran will employ what it has in power to help restore security and stability to those countries plagued by terrorism, the Iranian official said, pledging his country’s determination to boost cooperation with regional countries, including the Afghan government, to that end.

Taliban and the Daesh Takfiri terrorist group have regularly clashed since the latter gained a foothold in eastern Afghanistan in 2015.

The two compete for dominance in war-torn Afghanistan, which has been suffering from violence and militancy since the US-led invasion of the country in 2001.