The attack happened on Friday at an army base near the northern city of Mazar-e Sharif.
Insurgents dressed as soldiers targeted troops leaving Friday prayers at the base's mosque and others in a canteen, the army said.
It is not clear how many people died.
The Afghan defence ministry has not released firm casualty figures, only saying more than 100 were killed or injured. But one eyewitness told the BBC he counted 165 bodies.
On Sunday the nation held a day of mourning for those who died.