Militants have massacred dozens of civilians, mostly Shiainfo-icon Hazaras, in "a brutal, inhumane way" after attacking a village in a remote area of Afghanistaninfo-icon's northern province of Sar-e Pul, officials and locals say.

The militants, whose identity were not immediately known, raided a security outpost in the Mirzawalang area of Sayaad District in Sar-e Pul overnight Sunday, said Zabihullah Amani, a spokesman for the provincial governor.

Amani said the assailants were a mixed group of Taliban and Takfiri Daesh militants, and that there were foreign nationals among them.

During the raid, the militants set fire to several mosques, torched at least 30 houses, beheaded a number of villagers and shot dozens of others dead, other officials said.

The carnage occurred "in the province's predominately Shia village of Mirzawalang after insurgents captured it on Saturday," said Sar-e Pul Governor Mohammad Zaher Wahdat.

He added that "as many as 30 to 40 innocent people... were brutally shot and killed" in the raid; however, local elders in the village put the number of civilian victims at around 50.Up to seven members of the Afghan security forces were also killed and dozens of civilians were taken hostage by the militants.

No group has claimed responsibility for the carnage, which happened in the same area where the Taliban militant group had claimed a victory against the Afghan armyinfo-icon.

Following the civilian deaths, Taliban said in a statement that they had gained control of the Mirzawalang village, but dismissed reports of the massacre, calling it "hollow propaganda by the enemy."

Najib Danish, spokesman for the Afghan Interior Ministry also said, "Fierce fighting continued in Sar-e-Pul over the past two days, unfortunately civilians and military personnel have sustained casualties during the battles."

However according to The New York Times, "Sayad district had put up a fierce defense over the past two years against attacks by insurgents as other parts of the province seemed to be buckling under Taliban pressure. Several local officials say the Taliban joined forces with Sher Mohammed Ghazanfar, a local commander claiming allegiance to the Islamic Stateinfo-icon (daesh), to overrun the Mirza Olang area. Then he turned to blocking local militiamen, as well as civilians, from fleeing."

President Ashraf Ghani condemned the massacre, saying, "This barbaric act of them (militants) is deemed a direct violation of human rightsinfo-icon and a warinfo-icon crime."

 "Criminal terrorists have once again killed civilians, women and children in Sayad district of Sar-e Pul Province, adding to their crimes," said the president.

A senior government official in the capital, Kabul, said the army has sent more security forces and military equipment, including air force attack aircraft, to the area.

Afghanistan is still grappling with violence well over a decade after the USinfo-icon and its allies invaded the country as part of the so-called war on terror. The invasion removed the Taliban from power, but has failed to stop the militancy.

Taking advantage of the chaos, the Daesh, which is mainly based in the Middle Eastinfo-icon, has managed to establish a foothold in Afghanistan.