Gunmen attacked an Algerian military patrol in an area south of the capital, slightly wounding four gendarmes, the ministry of defense said, in an attack later claimed by Islamic State.
Attacks are rare in Algeria since the end of the country's 1990s civil war with Islamist militants, but al-Qaida in the Islamic Maghreb and small brigades allied to Islamic State are active in remote areas.
Gunmen opened fire on the gendarmerie patrol late on Wednesday in Larbaa area in Blida region, around 30 km (19 miles) south of Algiers, the ministry said in a statement carried on APS state news agency.
"A patrol of gendarmerie were targeted by gunfire on Wednesday at 2200 by a group of terrorists," the statement said without giving details on any militant group.
Islamic State-affiliated Amaq agency said on Thursday its fighters ambushed the patrol and claimed to have destroyed two vehicles, according to the SITE jihadist monitoring service.
Algerian armed forces have been cracking down on militants tied to Islamic State. In April, they foiled an attempted suicide bomb attack in the northeastern city of Constantine, with one attacker killed and a second arrested.
Islamist militants have carried out or attempted several attacks on security targets in Constantine in the past few months including the shooting of a policeman in a coffee house by three gunmen in October 2016.