Acting on intelligence tips, the army ambushed a meeting of militants in the Boukram forest in Boumerdes province, about 60 kilometers from the Algerian capital on Tuesday. The militants were allegedly planning to carry out operations on the capital, which has been largely free of terror attacks for several years.
The army continued its sweeps and killed three others who had escaped the initial attack and fled south through the rugged terrain, the ministry said.
The ministry's statement said more than a dozen Kalashnikov assault rifles were recovered, along with shotguns, a sniper rifle, a light machine gun, ammunition and grenades. Two militants were captured alive.
The two-day sweep was one of the most deadly anti-terror raids ever reported by the Algerian military.
The last major attack in Algeria was the attack on a desert gas plant in January 2013 that left 40 hostages, mainly foreigners, dead. It was claimed by a group headed by the feared Mokhtar Belmokhtar, loyal to al-Qaida but not to its Algeria branch.