The resurgence of undisguised military rule in Myanmar should provide inspiration for Donald Trump. The generals who jailed democracy crusader Aung Ang Suu Kyi and her cohorts are raising the same claims about Myanmar’s parliamentary elections in November that Trump has been charging in U.S. elections held around the same time. Having won only 33 of 476 seats for their candidates against 396 for Suu Kyi’s National League for Democracy, they say the voting was rigged, the count was fraudulent, and they want to look at the voting rolls.

The big difference between Trump and the generals in Myanmar is that they are able to exert their authority without having to worry about a legal system rejecting their ridiculous claims. Nor do they risk impeachment by a legislative body in which their opponents are capable of mustering enough votes to embarrass them severely if not throw out their leader, General Min Aung Hlaing, commander-in-chief of the army and, it seems, the country.

The line between dictatorship and democratic is narrow and often violated. Clearly Trump, by ranting and raving about election fraud, then spurring an unruly mob into an assault on the halls of the American Congress as it was about to certify the result of the presidential election, would love to reign unchecked by legal niceties. His failure to accomplish that goal marks both a victory for democracy and a signal that another more powerful demagogue might someday undermine and destroy the democratic system.

The tragedy of the Myanmar coup is that the country appeared on the way to a democratic form of governance that the vast majority of its 54 million people favor over military rule. The lesson of Myanmar is that attempts at democracy around the world risk the same fates.

Yes, the generals, under the constitution promulgated in 2008, were guaranteed one fourth of the seats in the parliament as well as the all-important posts of defense and home minister with authority over the national police. No, Suu Kyi, having been freed from 16 years of confinement to her estate in Yangon, formerly Rangoon, the country’s most important city, could not be president, according to the constitution, because her two sons by her marriage to her late husband, a British academic. are citizens of a foreign country. Given the title of state councilor, however, she was still seen as above the president, U Win Myint, who was also jailed.

The fact that Suu Kyi and her political allies were so easily ousted is all the more incredible after she supported the generals in their ruthless crackdown on the dissident Muslim minority, the Rohingyas, a million of whom have fled across the western border into Bangladesh. Her defense of the anti-Muslim campaign against genocide charges at the International Court of Justice in the Hague shocked those who had seen her as a heroine battling dictatorship. Who would believe that Suu Kyi, who won the Nobel Peace Prize in 1991 for campaigning for democracy, would align with the generals?

Military power-mongers do not easily share power with civilian reformers. Generals, trained in warfare, assume they are qualified to govern just because they have the weapons. So it was in Korea that Park Chung-hee, a general who had gone through military schooling in Japan, seized power on May 16, 1961, from a short-lived civilian government elected after the downfall of Rhee Syngman in the student revolution of April 1960. The struggle against military rule was a dominant theme in Korean life at least until mass protest forced Park’s successor, General Chun Doo-hwan, to agree in 1987 to a democratic constitution mandating presidential elections every five years.

Democratic institutions, though, are difficult to uphold. The instinct of bureaucrats is to stifle dissent. Military leaders at some stage grow restive and impatient, assuming they have the armed might to wipe away trouble-makers opposed to their view of law and order. Dictators also assume they are capable of running civilian agencies responsible for fields such as education and finance in which they have no skills.

Korea has gone through a terrific process from dictatorship to democracy. The system will be in jeopardy, however, if talk about North Korean human rights abuses is discouraged and concessions to dictatorship are an option. The U.S. is also surviving a challenge in the form of charges by a demented ex-leader who hopefully will fade into history. The Myanmar coup shows how swiftly seeming progress in any transition to democracy can go into reverse when the generals decide, whatever people think, their might makes right.