A dozen militants died when the bombs they were making exploded in northwest Afghanistan, ministry officials said on Wednesday.
The incident on Tuesday also injured six other people in the Ghormach district of Faryab province, which borders Turkmenistan, the interior ministry in Kabul said. It added that the dead included two local militant commanders.
Improvised explosive devices (IEDs) or home-made bombs are the weapon of choice for insurgents and are a frequent cause of death for foreign troops as well as civilians in Afghanistan.
There are around 140,000 international troops fighting a Taliban insurgency that is now in its tenth year.
The US-led coalition suffered its highest annual death toll last year with 711 fatalities, according to the iCasualties.org website.
International troops are due to start a limited, conditions-based withdrawal from July. Afghan forces are scheduled to take over responsibility for security in 2014.
Afghan officials say that last year 2,043 civilians died as a result of Taliban attacks and military operations targeting the militants.