SOMETIMES NATIONS seem to get stuck in loops of history, repeating the same crises and learning nothing from them. Such is the unfortunate case of Thailand. For a dozen years, its Bangkok-based political and business establishment has been unable to reconcile itself to the populist movement of Thaksin Shinawatra , which draws its support from the countryside and wins comfortable majorities in national elections. Rather than do the hard work of fashioning a winning alternative, the anti-Thaksin forces, with allies in the military, courts and entourage of Thailand’s king, have employed a coup, court rulings and street insurrections to drive three elected governments from power in the last seven years. Then, lacking support, they inevitably are compelled to hold another election — and the Thaksin party wins again.

After two years of relative calm under the latest elected government, headed by Yingluck Shinawatra, Mr. Thaksin’s sister, the reactionary forces have returned to the same losing strategy. Led by a former parliamentary deputy of the opposition Democrat Party, the so-called “yellow shirts” and their allies are besieging government ministries and clashing with police. This time they say their aim is not just to bring down the government, but to replace it with an unelected “people’s council” — presumably so as to avoid future electoral defeats.

After a weekend of violence, the street conflict de-escalated on Tuesday as police allowed demonstrators to penetrate government compounds. Protest leader Suthep Thaugsuban announced a pause for the king’s birthday. The opposition would be wise to use that as a face-saving way to end the crisis. But wisdom does not seem to be Mr. Suthep’s strong suit: He’s promising to “continue fighting” because “the tyrannical Thaksin government endures.”

That government certainly has its flaws, though tyranny is not one of them. Ms. Yingluck provoked the latest crisis by attempting to pass an amnesty bill in parliament that would have annulled a criminal conviction of her brother and allowed him to return from exile. Mr. Thaksin, for his part, even while in exile appears to be playing a major role in the government. His own administration, from 2001 to 2006, was guilty of human rights abuses as well as misguided economic policies.

Ms. Yingluck wisely withdrew the pardon bill and won a vote of confidence in parliament. She offered dialogue with the opposition, but Mr. Suthep refused. Fortunately, the government tried to avoid the violent clashes that marked previous Thai crises — and there are signs that both the business community and elements of the Democrat Party are exasperated by Mr. Suthep’s extremism. The military, too, has carefully remained on the sidelines so far, offering to mediate but not to intervene.

The opposition is still pursuing court cases against the government and may return to the streets. But the only way out of Thailand’s endless turmoil is for both sides to commit themselves to democracy and the rule of law — and for the Democrat Party to channel its discontent into the next election campaign.