Provincial spokesman Emdadullah Muhajir stated that at least 15 people killed 20 others were also wounded in the explosion in the school in Aybak, the capital of Samangan, on Wednesday.
“A blast took place around 12:45pm inside Jahdia Madrasa in the centre of the city. Lots of boys are studying at this madrasa [religious school],” he said.
Muhajir added an investigation had begun.
There was no immediate claim of responsibility.
“Our detective and security forces are working to identify the perpetrators of this unforgivable crime and bring them to justice,” The federal interior ministry spokesperson Abdul Nafi Takor noted.
A doctor in Aybak, about 200km (124 miles) north of the national capital Kabul, said the casualties were mostly youngsters.
“All of them are children and ordinary people,” he told the AFP news agency, asking not to be named.
The Taliban says it is focused on securing the war-torn nation since taking over the country last year.
However, several attacks have taken place in recent months, some of which have been claimed by Daesh terror group.