AUSTIN CURTIS-UNSPLASH

IT MIGHT look like the replacement of Bangladesh鈥檚 long-serving prime minister, Sheikh Hasina, by Nobel laureate Muhammad Yunus is a happy ending for a country that seemed to be inexorably sliding towards authoritarianism. After all, Hasina鈥檚 rule had become so paranoid that she even burned political capital on persecuting Yunus, widely feted for his role in rural development in Bangladesh and beyond. But, although Hasina鈥檚 exit was overdue, what comes after might wind up being worse.

We should be wary of seeing this as a simple victory for widespread, weeks-long popular protests, sparked by students in Dhaka. As in Egypt late in the Arab Spring, when pro-democracy protests against an elected president actually tipped the country into military rule, the prime mover was in fact an army desperate to protect its privileges. Cairo feels less free and prosperous now than it did a decade ago. Will Dhaka fare any better? Hasina was pushed off-stage relatively swiftly once the military switched sides: After 15 years in power, she was reportedly to get out of town.

Yunus, while popular, has no political base from which he could challenge the uniforms. The only organized opposition in Bangladesh 鈥 again, shades of Egypt here 鈥 is on the more Islamist side of the spectrum. With Hasina gone and her party and movement discredited, it seems clear that these are the forces that will make a play for power. The leaders of the student protests understandably reject this possibility. But, as in Cairo in 2013 or Teheran in 1979, the protesters may not completely comprehend the forces they have allied with and unleashed. Hasina鈥檚 departure was celebrated by attacks on the homes, businesses and temples of the Hindu minority the country.

When her rivals in the Bangladesh Nationalist Party last ruled in the 2000s, the country quickly became the source of a worrying amount of cross-border terrorism. After Hasina was elected in 2009, she cracked down on militancy. As a consequence, Bangladesh outperformed on growth, development, and poverty reduction during her tenure. Even noted the contrast with the illiberal chaos that has crippled their economy.

Hasina could be trusted to keep Bangladesh from descending into a Pakistan-style maelstrom of fanaticism because she viewed Islamists as personal enemies: They collaborated with Pakistani colonizers, and killed her father. Bangladesh鈥檚 first prime minister, Mujibur Rahman, was an omnipresent image in his daughter鈥檚 now-vanished regime. Mujib, as he is known, is widely respected for leading the Bengalis鈥 struggle against Punjabi-dominated Pakistan before independence in 1971. The most dangerous aspect of Hasina鈥檚 increasingly oppressive grip on power is that, alongside destroying her own legacy, it may have tarnished her father鈥檚 beyond repair.

This is not a quarrel about dead history, but about live ideology. Mujib and his movement are associated with the Bengali language and nationalism; his opponents 鈥 who staged a coup in the 1970s that killed him and most of his family except for Hasina (and her sister, Rehana, who is with her now in India) 鈥 are much closer to the political Islamism that both defines and has derailed the Pakistani project.

None of this exonerates Hasina, who wound up rigging one election too many. Her overthrow should not come as a surprise to anyone paying attention. The problem is that nobody has been paying attention. It鈥檚 time for that to change.

India and the West cannot evade responsibility here. New Delhi has tied itself so closely to Hasina in the public imagination that it has ended up being seen not a proponent of democratic values but as a dictator鈥檚 primary prop. The West, meanwhile, to convince Hasina of the benefits of democratization. As long as labor rights appeared to progress, it didn鈥檛 care about the rest of its Bangladesh policy 鈥 which, by the end, was being set by a restive and politically influential Bangladeshi diaspora now dominated by those ideologically opposed to Hasina and her father. Mujib鈥檚 statues may have been attacked back home, but this echoes actions in the West; soon after her downfall a rowdy group of expatriates into Bangladesh鈥檚 New York consulate to forcibly remove his portrait from there, as well.

We will pay for these errors. Bangladesh has appeared normal for so long that we have forgotten how dangerous it would be for it to become chaotic. The world鈥檚 third-largest Muslim-majority nation has largely avoided sectarianism. That鈥檚 thanks partly to the strength of Bengali cultural nationalism. But it鈥檚 also because it was born in opposition to Pakistan, an Islamic republic. Half a century ago, following its traumatic independence from Pakistan, it faced such starvation that The Beatles鈥 George Harrison decided to organize the first superstar charity concert in history. Today, the poverty rate is and still declining.

Hasina鈥檚 party and government took credit for both these achievements. In doing so to justify their vice-like grip on power, they may have convinced Bangladeshis that these are not achievements worth keeping. That would be a tragedy for Bangladesh. And it would be dangerous for India, the West, and the world.

BLOOMBERG OPINION