Friday was the 10th anniversary of a military-backed coup that halted the electoral process in Algeria, after a first round of voting assured the Islamic Salvation Front of a huge majority in Parliament. In the name of safeguarding democracy from religious extremism, the new military rulers canceled the second round of voting, ousted the president, banned the front and arrested its leaders and supporters.

Western powers, along with many Algerians of good faith, were relieved to see the army block the Islamists' victory, no matter how free and fair the vote may have been. They feared that the front, once in control of the legislature, would jettison democracy, back militant causes abroad and trample the rights of women and others who rejected their interpretation of Islam.

Free elections in the Middle East may have outcomes that scare Western democracies. But as Algeria's black decade shows, Western interests and values are ill served by failing to hold accountable regimes that claim legitimacy on the grounds that they are bulwarks against theocracy. Yet Western governments are today drawing closer to the Algerian president, Abdelaziz Bouteflika, who has loudly endorsed President George W. Bush's war on terrorism.

Since July, the two leaders have met twice at the White House, the first such presidential meetings since 1985. Algeria has reportedly handed the United States a list of 350 Algerians abroad with links to Qaida. The Bush administration is said to have eased restrictions on arms sales to Algeria that would aid the security forces in combating armed groups.

Since the elections were stopped a decade ago, up to 150,000 Algerians have been killed in a conflict between ruthless security forces and armed Islamists, whose jihad degenerated long ago into the butchering of civilians. In 10 years, the authorities have not brought the country closer to democracy, tackled the economic problems that fuel political extremism or kept terrorism from spilling beyond the country's borders.

True, the government's military superiority and its controversial amnesty for insurgents have reduced the death toll to about 100 per month, and the country has an elected president and Parliament again. But the political system remains tightly controlled by a military- dominated clique, and ordinary citizens get angry about the same old issues government arrogance and corruption, 30 percent unemployment, severe shortages of water and housing, and an economy that is in a shambles.

These same issues led millions to vote for the Islamic Salvation Front in 1991. Last year the frustrations of the Berber population erupted into deadly confrontations with the security forces.

Algeria's conflict has fed terrorism in the West, from a spate of fatal bombings in Paris in the mid-1990s to the many Algerians arrested in Europe in recent months on suspicion of Qaida links. But it would be self-defeating for the West to embrace the Algerian government as an anti-terrorist ally without also pushing it on the political and human rights issues that contribute to long-term stability.

Oil-rich Algeria may seem impervious to outside pressure, but President Bouteflika's incessant foreign travel, and his signing Dec. 19 of an association agreement with the European Union that contains a clause on human rights, testify to the government's eagerness for international legitimacy.

Western governments should be telling Algiers that closer ties depend on curtailing the impunity enjoyed by the security forces, not only for their unlawful actions against suspected Islamists, but also for their killing of dozens of unarmed demonstrators for Berber rights in 2001. Legislative elections this spring must be freer than the last ones, held in 1997. All political parties committed to nonviolence and pluralism should be allowed to compete.

Such measures will not persuade all militants at home or abroad to lay down their weapons. But they will signal a commitment by the government to address at last some of the conditions that have helped to make Algeria both a victim and exporter of violent extremism.