The Afghan government has dispatched special forces to a remote village over fears that Taliban and Islamic State insurgents have taken several families hostage after massacring dozens of civilians, officials said Tuesday.

Fighters from the two groups killed around 50 men, women and children in Sayad district of northern Sar-e Pul province on Saturday after overrunning a government-backed militia in a 48-hour battle, according to local officials.

Spokesmen from both the central and provincial governments said they believed the insurgents were holding a number of residents of Mirzawalang village hostage.

‘An unknown number of people have been taken hostage,’ defence ministry spokesman Dawlat Waziri told AFP.

‘Commando forces have been deployed to the area, air strikes are being carried out as we speak, and commanders on the ground are busy planning the recapture of the valley.

‘The operation to retake the valley will happen soon, and the terrorists will pay for their crimes,’ he added.

Waziri put the death toll from Saturday's atrocity at 34 but Zabihullah Amani, a spokesman for the provincial governor in Sar-e Pul, said 50 people had been killed. The majority of those killed were Shias.

Verifying information from poor, mountainous areas of Afghanistan made inaccessible by fighting and with patchy communications is difficult, and AFP was not able to access the village.

‘Since the villages is cut off, we can't confirm any new killings by the terrorists,’ Amani told AFP.

‘But as many as 150 families are being kept hostage there,’ he added.

Amani has said that dozens of Taliban and IS group fighters, under the command of a local Taliban commander who he claimed pledged allegiance to IS, launched a co-ordinated attack on the area on Thursday.

They defeated the Afghan Local Police (ALP) on Saturday before massacring civilians, he claimed.

Sediq Sediqi, a spokesman for the Afghan government, told AFP it was difficult to know numbers of civilians being held but said ‘President Ashraf Ghani has instructed everyone to do everything to safeguard those people’.

The Taliban have confirmed capturing Mirzawalang but said it did so alone. It has also denied allegations it had killed civilians.

Taliban and IS fighters have regularly clashed in Afghanistan over the past two years but security sources say they have teamed up in the past to strike Afghan forces in certain areas.

Related Story