Today the civil war that broke out in 1992 and has claimed some 150,000 lives is on the wane, but a vast potential fighting force lurks among the ample ranks of the unemployed and legions of others with nothing much to lose.
After President Abdelaziz Bouteflika, who is seeking re-election on Thursday against five challengers, came to power in the north African country in 1999, he sought to end the bloodshed by authoring an amnesty law to encourage Islamist rebels to surrender.
Convinced that appeasement was the only viable course, Bouteflika defied harsh criticism to amnesty thousands of rebels who -- at least officially -- had not committed "blood" crimes or rape.
The former fighters received government handouts to aid their return to normal life, a source of outrage among critics who found the policy far too lenient towards men they considered brutal killers.
They have been more or less rehabilitated, albeit in a country of 32 million where the unemployment rate is officially nearly 25 percent, with nearly half of those under 30 seeking work.
This policy, combined with sweeps by security forces in cities and the bush to track down rebel holdouts, has gradually stemmed the massacres and killings.
Death tolls compiled from official sources and press reports show a steady decline in recent years. More than 2,000 people were killed in 1999 and again in 2000; the figure dropped to 1,900 in 2001 and 1,400 in 2002, while last year's violence claimed 900 lives, nearly half of them rebels. Since the start of 2004, nearly 150 people have been killed, of whom some 75 were rebels.
"This dual policy of carrot and stick linked to the divisions prevailing between these groups has brought about an improvement in the security situation, especially in the cities, where attacks have become extremely rare," a security source told AFP in Algiers.
Those still at large belong essentially to two groups that have rejected Bouteflika's reconciliation program: the Armed Islamic Group (GIA) and the Salafist Group for Preaching and Combat (GSPC), which has been linked to Al-Qaeda. Both groups have practically evaporated, according to the source.
But observers say the threat of Islamic extremism persists, and press reports occasionally tell of disaffected youths joining the extremists.
"Unemployment, bad living conditions, low wages, the lack of housing for a population that has more than tripled since independence, as well as growing illiteracy produce a breeding ground for extremists," a Western diplomat said.
"Street movements, and even the riots which we are starting to see regularly, could be a vehicle for establishing an Islamic republic," he said.
Riots in 1988 led to a new constitution allowing multi-party politics, ending decades of single-party rule by the National Liberation Front (FLN), the force that led the country to independence from France in 1962.
The first pluralist elections to be held were local polls in 1990, won by the Islamic Salvation Front (FIS), benefitting from people's desire for a profound change in their living conditions.
When FIS, vowing to set up an Islamic state in Algeria, went on the win the first round of parliamentary elections in December 1991, the army called off the second round in early 1992, a move that sparked the civil war.