ALGIERS — At least nine Algerian soldiers were killed when militants ambushed their patrol west of the capital Algiers last week in one of the deadliest attacks in months, the Defence Ministry said on Sunday. Al-Qaeda in the Islamic Maghreb claimed Friday's attack in the Ain Defla region in a statement posted on a social media account that often releases its communiques. A security source on Saturday had said 11 soldiers were killed. Sunday's statement from the ministry was the first official confirmation of the attack. "A detachment of the army was targeted by a terrorist group. We deplore the death of nine soldiers as martyrs and two injured," the ministry statement said. Since Algeria's conflict with armed Islamists in the 1990s in which more than 200,000 people were killed, it has become one of North Africa's most stable states and is a key ally in the Western campaign against militancy in the region. But Al-Qaeda-allied fighters under veteran commander Abdelmalek Droukdel, and rival fighters who split to declare loyalty to Daesh (the so-called IS), are still active in pockets of the country, mostly in remote mountain areas. One security source said Droukdel may have been involved in the ambush as a way to show Al-Qaeda presence on the ground. Gunmen claiming loyalty to Daesh, which controls swathes of Iraq and parts of Syria, have been gaining ground in neighboring Libya, where a conflict between two rival governments has created a security vacuum. Daesh has claimed two major attacks on foreign tourists in Tunisia. Authorities say gunmen in the Sousse beach resort attack last month and the March gun assault on the Bardo museum in Tunis were trained in jihadi camps in Libya. But an Al Qaeda-allied group Okba Ibn Nafaa has been the most active, mostly along the border with Algeria, carrying out attacks on the military and police. It was also blamed by government for the Bardo attack. — Reuters