Elections have always been a tumultuous affair in Bangladesh. December 29, 2008, was no different. On that sunny winter day, more than 70 million lined up to vote, and heartily replaced a two-year-long state of emergency with a parliamentary government.

These elections were special for the United States. Senator John McCain’s first post-November foreign trip included Bangladesh, where he stressed the importance of the elections. The US ambassador to Bangladesh asserted in a Congressional hearing that the American elections aside, “there’ll be no more transformational election in the world this year than the parliamentary elections scheduled for December 29 in Bangladesh.”

Indeed, the elections will be doubly successful if they help promote a long-overdue transformation in US policy toward Muslim countries.

In early 2007 Western diplomats, led by Americans and the British, cheered when the military snatched the country’s reins from bickering politicians. The diplomats’ worldview, imbued by the black-and-white discourse of the war on terror, could not make sense of the messy, fluid politics of Bangladesh. That politics was seen to promote extremism and threaten the West’s investments, and it needed to be countered by the military’s heavy hand.

The military top brass negotiated with the West a soft coup; a direct takeover, the local UN representative had noted, might jeopardize the military’s lucrative UN peacekeeping role. And so a facade was set up, a caretaker government led by an ex-World Banker to scrawl civilian signatures on the dotted line.

The World Bank and the Asian Development Bank promptly opened up generous new lines of credit to help the new government’s “anti-corruption” drive. Elaborate security systems were set up to tap cellphones and the Internet. A political purging ensued with the usual markings: mass arrests, summary trials, torture and intimidation, lengthy prison sentences. Bangladesh’s dreaded intelligence agency became the foremost decision-maker.

This agency’s hand was heavy indeed, but clearly selective. While half a million were detained with little legal recourse, leaders of the main Islamist party, including war criminals from the 1971 genocide in Bangladesh, were left outside the dragnet. While jailing many political leaders on corruption charges, the government began a spending spree with no transparency, including replacement of the entire national airlines fleet in a sudden deal worth $2.5 billion.

The international development banks got the government to close or sell public enterprises and reduce subsidies. As fear of persecution kept local merchants at bay, the paramilitary was given contracts to import and sell food. Yet inflation soared to its highest level in decades. Except for a fiercely suppressed campus uprising, discontent simmered underneath autocratic rule.

The underperformance of the government confounded the diplomats. Of special concern was its approach toward Islamist extremism. Early in its tenure the government demonstrated its anti-extremism credentials by summarily executing six “ringleaders” of a fringe group. But critics whispered that this was really a distraction, similar to the token gestures Pakistani authorities display when pressured by the United States.

Indeed, the immunity of mainstream Islamist leaders, coupled with the caretaker government’s wholesale denigration of politics, its desire to force former prime ministers into exile, militarization of the administration, expansion of military-backed businesses, legal and judicial tampering, and the decision-making centrality of the intelligence agency–these institutional changes began to correspond to the Pakistani model under recent dictator Pervez Musharraf. And if that were to continue, the consequences would be equally uncertain and counterproductive for the United States. The elections had to be held, especially when the overwhelming majority of people wanted elected politicians back in power.

The election results were remarkable. The Awami League, the main center-left party, won by a landslide, and Jamaat-e-Islami, the mainstream Islamist party, was crushed. And in this lies the crucial lesson for the United States.

Since 2001 the wholesale logic of the war on terror has pushed US foreign policy toward many dubious judgments. In Bangladesh the Bush administration sided with a center-right party that seemed modern, pro-West, and pro-investment. But Islamist extremism in Bangladesh escalated precisely under that right-wing government. Then, to counter the threat, the United States jettisoned democratic principles altogether, supporting an authoritarian takeover with the hypothesis that brute force will stamp out extremists. It found, yet again, that authoritarian methods wind up either protecting or fanning extremism.

In the end, it is the overwhelmingly Muslim electorate of Bangladesh that rejected extremism and handed Jamaat-e-Islami a thumping defeat. And the defeat was decisive because Jamaat was part of the right-wing government under which both terrorist violence and corruption skyrocketed. In other words, it performed badly, so it was booted out. And that’s exactly how electoral democracy is supposed to work.

But instead of allowing the local democratic process to choose winners and losers, the United States and its allies are quick to cry foul and interfere whenever an Islamist party threatens to win elections. We saw that in Algeria in 1991, in Turkey in 1996, in Palestine in 2006. These interventions cascaded into a decade-long civil war in Algeria, dissolution of the Islamist government and the party in Turkey at gunpoint, and stifling sanctions and state-sponsored brutality in Palestine–but in no case can the United States claim to have defeated Islamism. If anything, authoritarian interventions have only strengthened the popular basis of Islamist alternatives, and at times for good reason.

In Muslim countries around the world, the United States really needs to let democracy take its own course. It will be messy and scary at times. In Bangladesh just yesterday, the paramilitary border guards staged a mutiny against their army commanders, citing longstanding repression and killing at least twenty. The newly elected government skillfully controlled the negotiations, but its offer of amnesty may increase tension in the army, parts of which may seek retaliation against the mutineers. Bangladesh’s democracy will have difficult episodes over the next few years. Polished modernists will coexist with devoted traditionalists who shun English. There will be parliamentary walkouts and raucous brawls, even extremist threats.

Through it all, a new opposition platform will take shape. This may have an Islamist angle, or Chavez-like populism, or a pro-growth agenda, or something completely different. It may be pro-West or anti-West. Whatever it is, the United States should support the institutions of democracy and show respect for the verdict of local voters rather than scheme to install preferred rulers. If it’s extremism that the United States is worried about, then there is no better alternative than to let it expose itself, and be rejected by the electorate, eventually.