The ministry said late on Tuesday the army had killed 22 fighters in Bouira province in a region that was an Islamist militant stronghold during a 1990s civil war that left 200,000 people dead.
Fighters allied with both al-Qaida in the Islamic Maghreb and Islamic State operate in Algeria, mostly in mountainous northern areas, but militant attacks have been rare since the war with Islamist insurgents mostly came to an end in 2000.
The military has given no details or mentioned the affiliation of the fighters involved.
But security sources on Tuesday said the strike was against members of the Caliphate Soldiers, an al-Qaida splinter faction that had declared allegiance with Islamic State militants who control territory in Iraq and Syria.
Last September, the Caliphate Soldiers kidnapped and killed a French tourist in the mountains east of Algiers. Since then, Algerian security forces have carried out increased security operations in the area.Algeria has become a key partner in the Western campaign against insurgencies across North Africa, especially in northern Mali and Libya.