PARIS (Reuters) - Nearly 50 years after Algeria won independence from France, the unhealed wounds of the war of decolonisation keep wrenching at French society and could play a key role in the 2012 presidential election.
The unending Algerian trauma explains why France finds it so hard to integrate its large Muslim minority, why second and third generation Muslims of Maghreb origin born in France often feel alienated from their country of birth, and why politicians continue to find fertile ground in their quest for votes.
"There is an endless battle of memory, both within France and between the French and the Algerians," said Benjamin Stora, the leading French historian of the Maghreb.
In the last few weeks, a law has come into force banning the wearing of the face-covering Islamic niqab veil in public, and parliament is debating a bill to strip recent immigrants of their French citizenship if they commit certain serious crimes.
Both measures were part of an offensive by conservative President Nicolas Sarkozy to woo voters hostile to immigration, many of whom believe France has too many Arabs and Muslims.
Meanwhile, five French citizens kidnapped last month from a French-run uranium mine in Niger that supplies France's huge nuclear industry are being held somewhere in the Sahara desert by militants linked to al Qaeda, led by Algerian Islamists.
The hostages were taken ostensibly in retaliation for a failed Franco-Mauritanian commando raid to try to free another French hostage killed in Mali in July, in which at least six militants of Al Qaeda in the Islamic Maghreb were killed.
Sarkozy won office in 2007 declaring that the French had no reason to repent for their colonial past, and promising to create a foundation to honour the memory of those who died fighting for France in the 1954-62 Algerian war.
That stance, and a reputation for toughness on law and order and immigration earned as interior minister, helped him win back many voters who had deserted the centre-right UMP party for the extreme right National Front since the 1980s.
Although he considers himself the spiritual heir of General Charles de Gaulle, who faced down political and military opposition to self-determination for Algeria, Sarkozy has taken care to flatter former French colonists and their descendants.
These so-called "repatriated" Europeans, and Muslim "harkis" who fought in the French army against Algerian insurgents, make up nearly 2 million people with their families. Most resettled after 1962 around France's Mediterranean coast.
They are a significant electoral force in cities such as Nice, Marseille, Montpellier and Perpignan. Many voted for the National Front of Jean-Marie Le Pen, a former paratrooper in Algeria who advocates a total halt to immigration.
Some of them protested in May outside the Cannes film festival against the screening of Algerian director Rachid Bouchareb's movie "Outside the Law," which depicts a 1945 French massacre of peaceful Algerian protesters.
The "repatriated" are now tempted to revert to the National Front, headed by Le Pen's charismatic daughter, Marine.
The "nostalgeria" of part of the French right and the feelings of alienation and loathing of rootless Arab youths of Algerian origin feed on each other.
Young Arabs raised in rough high-rise suburbs around French cities play into the hands of populist politicians when they boo the Marseillaise national anthem at soccer matches or stage motorcades waving Algerian flags during the World Cup.
Algerian writer Slimane Zeghidour says there was an eerily parallel incident in the Algerian town of El Bouni in June, when angry youths stormed the local town hall, burnt the Algerian flag and defiantly brandished a French flag.
"It says a lot about the lopsided relationship between two countries which remain prisoners of a shared history," Zeghidour wrote in Le Nouvel Observateur magazine.
Algeria's rulers still try to use the memory of French colonial brutality to unite their people behind the government. But for many ordinary Algerians, fresher resentments were born of a civil war in the 1990s between the military regime and Islamist rebels, in which at least 150,000 people died.
In France, the police shooting of a suspected armed robber of Algerian origin sparked three nights of riots in a suburb of Grenoble in July. Sarkozy blamed the flare-up on the failure of policies to assimilate immigrants, but he called for tougher punishments rather than new measures to improve integration.
France does not allow the collection of ethnic statistics, so it is hard to tell how many of the country's estimated five to six million Muslims are of Algerian origin, since the overwhelming majority have only French citizenship.
Compared to Britain, the United States or Belgium, relatively few second-generation immigrants have risen to prominence in politics, business or the media in France, and even fewer of Algerian origin.
The enduring Algerian conflict also poses problems for France's opposition Socialists, since while they aim to capture as much as possible of the ethnic minority vote, they dare not appear softer than Sarkozy on immigration or violence.
Stora has put his finger on one Socialist wound with a book revealing that Francois Mitterrand, the president who abolished the death penalty in 1981, sent 45 independence fighters to the guillotine as justice minister during the Algerian war.
Stora's findings, based on recently released archives and interviews with retired officials, undermine Socialist accounts of the period which contended that Mitterrand tried to moderate the brutality of French repression in Algeria.
Algerian President Abdelaziz Bouteflika, 73, was an activist in the National Liberation Front during the war against France, but Sarkozy was still in short pants when the war ended.
Yet even when the post-war generation is in power on both sides of the Mediterranean, the scars are unlikely to heal.
Editing by Michael Roddy