The Afghan interior ministry said all those killed last evening in the Khanabad district of Kunduz province were civilians, although local officials called them anti-Taliban militiamen.
The Taliban claimed responsibility for the attack, which comes after a barrage of bombings in Kabul killed at least 51 people yesterday, the deadliest day for the capital in years.
"The incident took place (when) a suicide bomber detonated his suicide vest in Khanabad district," the interior ministry said, strongly condemning the "heinous act".
But Abdul Wadood Wahidi, spokesman for the governor of Kunduz, said 22 militiamen -- including four of their commanders -- were killed by an improvised explosive device.
Also Read
Kunduz is a volatile province where the Taliban recently came close to overrunning Kunduz city, in the most alarming threat to any provincial capital since the 2001 US-led invasion of Afghanistan.
The insurgency has been rapidly spreading across the north from its traditional southern and eastern strongholds, with Afghan forces increasingly battling the militants on their own.
US-led NATO forces ended their combat mission in Afghanistan in December last year, although a 13,000-strong residual force remains for training and counter-terrorism operations.
They were the first major attacks since Mullah Akhtar Mansour was named as the new Taliban chief last week in an acrimonious power transition after the insurgents confirmed the death of longtime leader Mullah Omar.
The wave of violence has underscored Afghanistan's volatile security situation amid a faltering peace process and the potency of the Taliban insurgency, despite it being riven by growing internal divisions.
Experts say the growing number of attacks demonstrates Mullah Mansour's attempt to boost his image among Taliban cadres and drive attention away from internal rifts over his leadership.
With Afghan forces suffering record casualties as foreign troops pull back, Kabul is increasingly relying on informal militias as a bulwark against the insurgents -- a gambit observers say is akin to fighting fire with fire.