The prospective collapse of democracy in predominantly Sunni Muslim Bangladesh is raising concerns reaching far beyond the politically divided south Asian nation of 145 million people. A state of emergency and intervention by the army are distinct possibilities if already delayed elections fail on January 22. There are precedents aplenty: two presidents have died in military coups since independence from Pakistan in 1971 and the restoration of democracy in 1991 has if anything deepened the destructive enmity of the two main party leaders.

The main beneficiaries of institutional failure could be violently militant Islamist fringe groups such as the Jagrata Muslim Janata and the Jamaat-ul-Mujahideen, opposed to the country's secular liberal tradition. The International Crisis Group links these organisations to an upsurge in terrorist violence in 2005, including the country's first suicide bombings. A crackdown brought respite last year - although at a high price to civil liberties, according to a Human Rights Watch investigation into alleged "death squad" activities of the feared paramilitary Rapid Action Battalion.

"This may only be a temporary suspension, with sponsors of the militants worried that violence was becoming an electoral and diplomatic liability," the Crisis Group report warned. "The issues of foreign funding of extremism and the growing madrassa system are concerns for the long term ... circumstantial evidence, as well as cold political logic, suggests underground terrorist groups have been cultivated and sheltered by those in power."

Increasingly influential, too, is the more moderate Jamaat e-Islami, part of the coalition administration led by Begum Khaleda Zia's Bangladesh Nationalist party (BNP), which left office last October. "The Jamaat is well placed to take advantage of continued political wrangling, though at present electoral success seems implausible," said Gareth Price in Chatham House's World Today magazine.

With an electoral boycott threatened by the main opposition party, Sheikh Hasina Wajed's Awami League (AL), and troops deployed on the streets amid escalating protests, the outlook was worrying, Mr Price said. "The use of violence as a form of political negotiation seems certain to continue as polling day approaches. It is likely that whoever loses will claim the poll was rigged and protests will continue."

Disputing poll results is a bipartisan tradition in Bangladesh. The difference this time is that an AL-led boycott would destroy the election's credibility, guaranteeing further instability. The interim government overseen by President Iajuddin Ahmed insists the polls take place on time for constitutional reasons. But Sheikh Hasina is demanding prior changes to the electoral roll. She also says the election commission is biased and Mr Ahmed should resign. The BNP demands that the polls proceed.

Worried for the economy, the Federation of Chambers of Commerce and Industry has called for a state of emergency if no compromise can be reached. But extra-constitutional intervention was not the answer, the New Age newspaper said. "The prescribed remedy is undoubtedly more dangerous than the malady."

The deepening crisis in one of the world's few Muslim democracies is causing alarm abroad. The US has urged a deal on the parties despite the system's "many imperfections". The EU warned that "a failure of the current electoral process would be a major setback for democracy and for the international credibility of the country".

But the Crisis Group said such hand-wringing was not enough; more active political engagement by western countries was required. "Short-term counterterrorism issues should not overwhelm the long-term issues of meeting standards in terms of elections, of improving oversight of security forces, and respect for human rights. Improving democracy is the best guarantee against the growth of extremism."