"Criminal terrorists have once again killed civilians, women and children in Sayad district of Sar-e Pul province, adding to their crimes.
"This barbaric act of them is deemed a direct violation of human rights and a war crime," Ghani said in a statement.
The comments came after the governor of Sar-e Pul said that "as many as 30 to 40 innocent people... were brutally shot and killed" in the province's predominately Shiite village of Mirzawalang after insurgents captured it on Saturday.
Mohammad Zaher Wahdat, the provincial governor, added that several mosques were set ablaze while an unknown number of villagers had also been taken hostage following a 48-hour battle between insurgents and Afghan security forces.
He said 12 insurgents and seven Afghan troops had been killed in the fighting.
The village is situated in an extremely remote part of the country, where both the Taliban and Islamic State group fighters have a presence, and AFP was unable to confirm the reports with independent sources.
The Taliban said in a statement that it had captured Mirzawalang village but rejected reports of civilians casualties, calling it "hollow propaganda by the enemy".
The incident comes after the Afghan government claimed last month that Taliban fighters had killed 35 people in an attack on a hospital in central Ghor province.
Officials later backtracked though, underscoring the difficulty of verifying information from poor, mountainous areas of Afghanistan made inaccessible by fighting and with patchy communications.
The Taliban is at the peak of its summer fighting season and has carried out a number of deadly attacks in recent days, including the killing of two US soldiers in a suicide bomb attack in Kandahar on Wednesday.