They report that a checkpoint manned by local police was attacked in the Mirzawalang area of Sar-e Pul province.
The assailants then entered the village and shot dead mainly Shia Muslim civilians including women and children, a spokesman for the provincial governor said.
"They were killed in a brutal, inhumane way," he added.
He reported that seven members of the Afghan security forces has also been killed, as well as a number of insurgents.
A combination of Taliban and Islamic State (IS) group fighters - including foreigners - were involved, he said. Both are Sunni Muslim militant groups.
The Taliban denied killing civilians, saying that its fighters had killed 28 members of a government-supported militia in the area.
Afghan President Ashraf Ghani condemned the attack.
"Criminal terrorists have once again killed civilians, women and children," he said in a statement.
"This barbaric act of them is deemed a direct violation of human rights and a war crime."
Fighting has intensified across Afghanistan in recent months. More than 1,662 civilians were killed in the half of the year, according to UN figures.
Can Afghan military turn tide in Taliban fight?
US President Donald Trump is considering whether to increase the number of US troops aiding the military and police in the country.
End of Twitter post  by @afgexecutive

Richards has not played since the 2-0 defeat by Derby County on 27 September, but will return to training before the Boxing Day trip to Brentford.
Warnock says Richards has taken longer than expected to return.
"I've had lads with broken legs recover quicker than him," he told BBC Wales Sport. "It has been difficult."
Warnock, who says he is looking to sign four players in the January transfer window, says Richards has endured a tough time.
"Jazz Richards is actually training tomorrow and hopefully he finishes training as well," he said.
"I know he will start it and then we will see what happens.
"It has been a difficult period for everyone concerned with Jazz.
"First of all, it would be nice to see him run.
"He hasn't done any training yet, so I can't be happy."
Warnock says he had hoped to use Richards as he looks to move Cardiff clear of the Championship relegation zone.
"He had a knee problem, then a calf problem and then another calf problem, so I don't know what is around the corner," he added.
"It is disappointing really, because I counted on him and it has left us very short in the defensive situation and I have to look elsewhere to make sure I have the numbers.
"I like Jazz, I have always liked Jazz, but unfortunately he has not been much use to me. I am sure he is disappointed himself."
Warnock also explained that he does not expect to make any attempt to sign 37-year-old Crystal Palace goalkeeper Julian Speroni.
Warnock has previously worked with Speroni when he was Eagles boss and has hinted that he could look to bring a goalkeeper to the Cardiff City Stadium in the January transfer window.
Cardiff sold captain David Marshall in the summer and replacement Ben Amos made a costly mistake in the 4-3 defeat by Barnsley.
But Warnock does not expect Speroni to leave Selhurst Park before he retires.
"Julian is a smashing lad, a really good goalkeeper, but he will be at Crystal Palace the rest of his career," he told BBC Wales Sport.
"He won't leave there. But there will be other names in the next few weeks."

Sadiq Khan claimed expanding the West Sussex airport was "the only option that can actually be delivered".
His letter to Theresa May was signed by 30 cross-party London MPs, council leaders and London Assembly members.
It claimed a second runway at Gatwick would be the "obvious choice" for the capital and Britain.
"Gatwick would not only require no public subsidy - a huge factor in our current uncertain economic times - but would give Britain all the benefits of expansion whilst keeping our air quality safe and within legal limits," Mr Khan said.
In her keynote address to the Conservative Party conference in Birmingham, Mrs May confirmed that the government would "shortly announce" which airport would get the go-ahead.
The shortlisted options being considered are a third runway at Heathrow, extending its existing northern runway and a second runway at Gatwick.
At least 50 civilians have been killed by militants in northern Afghanistan, officials say.
[NEXT_CONCEPT]
Cardiff City manager Neil Warnock says Wales defender Jazz Richards' rehabilitation from injury has been 'disappointing.'
[NEXT_CONCEPT]
The mayor of London has written to the prime minister in a last-ditch plea for an extra runway to be built at Gatwick Airport, rather than at Heathrow.