When Nepal's new pro-China communist prime minister, Khadga Prasad Oli, shortly pays obeisance in Beijing, he will seek not only greater aid but also the establishment of "brotherly" relations between the Chinese and Nepalese communist parties.

This year the number of communist-ruled countries in the world increased by one to six, with the landlocked Himalayan state of Nepal joining China, Cuba, Laos, North Korea and Vietnam. Nepal's two main communist groups merged into one party on May 17, about three months after jointly coming to power.

Nepal boasts the world's only democratically elected communist government. This development has revived a longstanding international question as to whether communism can reform itself to coexist with democracy. In Nepal, where communist China and democratic India are competing for influence, the answer will be affected by forces far beyond its borders.

Globally, most communist parties gained power by violent means. The Soviet communist system lasted 74 years -- the longest any autocracy has survived in modern history -- after it was established following two violent revolutions in 1917 that ended Tsarist rule and brought the Bolsheviks and Vladimir Lenin to power. The Chinese Communist Party, in power for almost 69 years, has established a Leninist one-party state that appears set to surpass the Soviet longevity record.

Communist rule in China was built with blood -- from the Red Army's march to victory, which cut a vast swath of death and destruction, to subsequent decades of fratricidal killings in political witch-hunts and other state-sponsored actions, including atrocities against Tibetans, Uighurs and Mongolians and the Tiananmen Square massacre of student-led demonstrators. Mao Zedong's "Great Leap Forward" caused the Great Famine of 1958 to 1962 that left between 35 million to 45 million people dead. Despite such a gory history, the CCP still retains the reins of power.

The Nepalese communists' peaceful ascension to power helps to obscure a violent past. Prime Minister Oli spent years in jail in the 1970s and 1980s, as a communist guerrilla, for waging war against the state. Nepal's 1990 establishment of multiparty democracy within the framework of a constitutional monarchy opened up legitimate political space for all groups, including the Maoists and Oli's Marxist-Leninist Party. The Maoists, influenced more by Mao's notion of peasant-based revolution than orthodox Marxism-Leninism, launched a bloody insurrection in 1996 with the aim of overthrowing the monarchy through a "people's revolution."

A decade later, a peace accord ended a protracted war between Maoists and government forces. India -- governed at that time by a shaky coalition government, dependent on the support of local communists who had links with Nepalese communists -- engineered not only the peace but also the abolition of the constitutional monarchy.

These developments paved the way for the Maoists and the Marxist-Leninist Party to share power with the Nepali Congress Party, dominant until then. In 2008, the Maoist chief was appointed prime minister, the first of a series of communists to head coalition governments. Severe political flux resulted in governments changing 10 times in the past decade, a period in which the two communist parties rapidly expanded their political base before sweeping the last national and state elections.

Today, the Nepali Communist Party, which was formed last week when the two communist groups merged, casts a long, ominous shadow over the country's politics: It has almost two-thirds majority in Parliament and governments in six of the country's seven provinces. Such domination raises serious risks for Nepal's sputtering democratic transition, which has been buffeted by one crisis after another.

There are portentous parallels with another country that came under communist sway through largely peaceful but uncommon means centered on a creeping approach exploiting democratic methods -- Czechoslovakia after World War II.

Just as national elections in Czechoslovakia in 1946 resulted in leftist and communist parties securing significant representation in the new constituent assembly and then gradually dictating terms to President Eduard Benes, the 2007-initiated constituent assembly process in Nepal helped communists to gain power and leave their imprint on the new constitution that took effect in 2015. And just as U.S. missteps, including terminating a large loan to Czechoslovakia, triggered a backlash that boosted popular support for communists, Indian blunders helped empower communists in Nepal, undermining India's own close relations with that country.

To gain political ground in the lead-up to the most recent elections, the Nepalese communists played the nationalist card, including whetting a deep-seated suspicion about India's intentions, in ways redolent of how the Czechoslovak communists whipped up anti-U.S. sentiment and drove out other coalition partners from the government. By 1948, the Czechoslovak communists gained full control of the government.

No less important is the fact that, just as the Soviet Union aided the Czechoslovak communists' march to victory, China has helped out the Nepalese communists. China reportedly persuaded the divided communists to form a coalition before the Nepalese elections, helped fund their campaign, and midwifed last week's birth of a new unified communist party.

When history is written, two blunders of India under Prime Minister Manmohan Singh will stand out for irreparably damaging its long-term interests in Nepal -- helping to bring the Maoists to the center-stage of Nepalese politics; and instigating the ouster of that country's more than two-century-old monarchy, the central pillar of stability, continuity and national unity. The void from the monarchy's fall was largely filled by the communists.

The paradox is that the Maoists secured the monarchy's overthrow not through their violent campaign but with the direct help of a country they considered their ideological foe. A double irony is that India remains plagued by its own Maoist scourge, unable to halt the rebels' periodic ambush-killing of police.

A predominantly Hindu India helped turn a Hindu kingdom (indeed the world's only officially Hindu country) into a secular, communist-ruled, China-leaning state, seriously eroding its own traditional influence there. India and Nepal share one of the world's most-open borders that permits passport-free passage, and China's increasing footprint in Nepal carries major implications for India's internal security.

More broadly, Nepal has emerged as a test case for whether democracy can survive under communist rule. Can communism become democratic? Or is there an inherent contradiction between communism and democracy?

One cannot ignore the fundamental divergences: Democracy enshrines and enhances individual rights and freedoms, while communism erodes and smothers them. Democracy is pluralistic, whereas communism in practice tends to be authoritarian.

Western hope that democracy would follow capitalism into communist states has been dashed. Fusing market capitalism with a one-party state, China has created its own model of authoritarian capitalism, which Vietnam and Laos have embraced and Cuba and North Korea are willing to adopt if the U.S. lifts sanctions against them. The CCP, as revealed by its 2013 circular known as "Document No. 9," views democracy as China's biggest threat.

Against this background, can Nepal be an exception? It is too early to determine but initial signs are not encouraging. Oli has already started undermining the independence of Nepal's institutions and stacking them with his own loyalists. One of his first decisions in office was to replace key figures in many institutions, including those loosely linked with the government. The already weak judiciary is in no position to stand up to the one-party domination. If the assault on institutions continues, Nepal will be emulating the trajectory of how Czechoslovakia turned into a single-party state.

Nepal's tenuous democracy has also come under pressure from ethnic fault lines that constitution-writing political machinations helped stoke. The new constitution reflects the will of the hill elites that have long dominated Nepal's power structure. Its enactment has fuelled discontent and unrest among the plains people, who inhabit the southern belt along the India frontier and feel discriminated against. Some of them wish to secede.

Czechoslovakia survived dismemberment by the Nazis and 41 years of communist rule only to split under democracy. In Nepal, communist domination will likely increase southern alienation. Make no mistake: Nepal's very future is at stake.

Brahma Chellaneyis a geostrategist and the author of nine books, including the award-winning "Water: Asia's New Battleground."