Bangladesh is on the edge of political chaos, and the intransigence of both the ruling Awami League and the opposition Bangladesh National Party is to blame. Unless both parties take immediate steps to pull back from entrenched positions, restrain the violent elements of their activist bases and embark on a genuine dialogue to restore legitimacy to Bangladesh’s troubled democracy, the wave of violence engulfing the country risks spinning out of control.

The latest crisis began just before the Jan. 5 anniversary of last year’s elections — the most troubled in Bangladesh’s history. The Bangladesh National Party boycotted the 2014 elections to protest the Awami League’s refusal to allow a caretaker government to oversee the voting, as had been the case since 1996. As a result, pro-government candidates ran unopposed in more than half of parliamentary districts. The result is that the Bangladesh National Party has been effectively excluded from mainstream politics, causing a sharp rise in fierce protests by activists in the party and its political ally, the Islamist Jamaat-e-Islami party.

Rather than seek a political compromise. Prime Minister Sheikh Hasina seems bent on neutralizing her opponents. On Jan. 3, Mrs. Hasina’s government confined the National Party’s leader, Khaleda Zia, herself a former prime minister, to her party’s headquarters in Dhaka.

Mrs. Zia and her party responded by calling for a transportation blockade and a general strike. Party goons have tried to enforce the blockade with violent attacks that have claimed 63 lives as of Feb. 7. Mrs. Hasina’s government has responded with a tough crackdown on protesters.