It is the latest in a string of deadly assaults against Afghan military sites, which underscores rising insecurity as Afghanistan braces for an intense spring fighting season.
The ministry did not give a breakdown of the casualties in the attack near Mazar-i-Sharif city yesterday, which lasted several hours and targeted soldiers at a mosque and dining facility.
The US military has said that "more than 50" Afghan soldiers were killed in the assault, while an Afghan army source who was on the base at the time put the death toll as high as 150, with dozens more wounded.
The defence ministry said Afghan forces had killed all the attackers, without specifying how many there were. Earlier it had said one of the assailants had been detained.
More From This Section
The military source at the base said there were at least 10 attackers, adding that the soldiers were "young recruits who had come for training".
The toll could change, the defence ministry said in a statement, adding it would provide more information once an investigation was completed.
Afghan officials put the death toll in that attack at 50, but security sources and survivors told AFP more than 100 were killed in the brazen and savage assault.
General John Nicholson, the top US commander in Afghanistan, praised Afghan commandos for bringing the "atrocity to an end".
Afghan security forces, beset by killings and desertions, have been struggling to beat back insurgents since US-led NATO troops ended their combat mission in December 2014.
The attack on the Kabul hospital in March came a week after 16 people were killed in simultaneous Taliban suicide assaults on two security compounds in the capital.
More than a third of Afghanistan is outside government control and many regions are fiercely contested by various insurgent groups, as Kabul's repeated bids to launch peace negotiations with the Taliban have failed.
Nicholson in February told the US Senate Armed Services Committee in Washington that he needed "a few thousand" more troops to help train and assist the Afghan forces.