"This evening 235 people including women and children were released from Mirzawalang as a result of mediation by the local elders and provincial officials," Zabihullah Amani, a spokesman for the provincial governor, told AFP.
"They have been safely evacuated to Sar-e Pul city, but there are still an unknown number of people being kept hostage there," he added.
An Afghan security source said he thought there were still around 100 people being held hostage in Mirzawalang, situated in the Sayad district of Sar-e Pul province, after insurgents captured it at the weekend.
Taliban and IS fighters killed around 50 men, women and children in the mainly Shiite village on Saturday after overrunning a government-backed militia in a 48-hour battle, according to local officials, who also said they took a number of residents captive.
"Despite the efforts of elders the bodies of the victims have not been recovered," Mohammad Zaher Wahdat, the provincial governor, told Tolo News, an Afghanistan television news channel.
"Two hundred and thirty-five hostages have been released. They are so shocked they can't even speak to tell us about anymore other hostages," he added.
Amani, the provincial spokesman, 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) after a 48-hour battle before massacring civilians, he claimed. The majority of those killed were Shiites. Most were shot or beheaded, he said.
- Special forces -
Afghan defence ministry spokesman Dawlat Waziri told AFP that 34 civilians were known to have been killed.
Before confirmation of the release of hostages Amani said that 150 families were being held while Waziri said "an unknown number of people" had been taken hostage.
"Since the villages is cut off, we can't confirm any new killings by the terrorists," Amani told AFP.
The Taliban 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.
"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," said Waziri, the defence spokesman.
"The operation to retake the valley will happen soon, and the terrorists will pay for their crimes," he added.
Sediq Sediqi, a spokesman for the Afghan government, told AFP it was difficult to know numbers of civilians concerned but said "President Ashraf Ghani has instructed everyone to do everything to safeguard those people".
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)