CHERCHELL, Algeria, Aug 27 (Reuters) - A suicide attack on an Algerian army barracks left many wondering how militants had managed to strike in one of the country's most secure locations and stirred dark memories of past conflict.
Two suicide bombers hit the barracks housing a prestigious military school in the coastal town of Cherchell west of Algiers on Friday, killing 16 soldiers and two civilians.
More than 20 people were injured, Algeria's state APS agency quoted the defence ministry as saying.
"When I found out that the barracks were hit, I couldn't believe it," said Yahia Keriani, who runs a book stall close to the compound and heard the explosions.
"Cherchell's military school is the biggest and the safest in the entire country. How is this possible?"
Algeria, an energy exporter and a key U.S. ally in its campaign against al Qaeda, is still emerging from nearly two decades of conflict between security forces and Islamist militant groups that killed around 200,000 people.
Violence has died down significantly in the past few years, but the militants -- who now operate as Al Qaeda in the Islamic Maghreb (AQIM) -- still carry out ambushes, kidnappings and occasional bombings.
Algeria has said it believes AQIM is exploiting the chaos in neighbouring Libya, and smuggling weapons out of that battlezone to its base in the Sahara.
On Friday, the attackers drove up to the barracks soon after iftar -- when Muslims break their daily fast during the holy month of Ramadan.
Residents said the first attacker blew himself up at the entrance before the second ran into the front courtyard where officers were sitting down to eat.
In the centre of Cherchell, about 100 km (62 miles) west of Algiers, small groups of residents gathered in front of the town's ancient Roman ruins to digest the news.
Many said Cherchell had always been secure, even at the height of Algeria's violence.
In the past, attacks had focused on territory east of the capital, including the mountainous Kabylie region, where AQIM has a stronghold.
"A suicide attack in 2011 against the military school of Cherchell is very worrying," one elderly resident told Reuters.
"A Muslim can't do something like this, killing innocent Muslims who were fasting," said another, who declined to be named. "I thought terrorism was over, but I was wrong." (Editing by Marie-Louise Gumuchian and Andrew Heavens)