On May 31, Thailand’s much revered King Bhumibol Adulyadej was admitted to a Bangkok hospital after returning from his seaside palace at Hua Hin just three weeks before. He was accompanied by his ailing wife, Queen Sirikit, who suffered a stroke in 2012. Their latest hospitalization is sparking speculation about the looming end of the Bhumibol era.

On the throne since 1946, Bhumibol is the world’s longest-reigning monarch. But his deteriorating health has caused anxiety among Thais about what will come next. This nervousness is partly due to the generally uncertain political environment now that the nation is once again in the custody of a self-appointed military government. But it is also the result of Bhumibol’s reign having been perhaps too successful: Can his successor match up?

Revered by the military, bureaucrats, big business and mainstream society alike, the king is extolled in schools and the media as both a demigod and a monarch. Photos released by the palace show him traveling through remote regions with maps and cameras in hand, a trickle of sweat on his brow.

The royal family has long played an indispensable role in Thai politics, especially by maintaining close relations with the military, even during periods of civilian rule. Over the years, Bhumibol has managed to become an indispensable partner of the generals, and they have cast themselves as the monarchy’s ultimate defenders.

In the late 1950s and early 1960s, the king developed ties with Field Marshal Sarit Thanarat, who ruled Thailand like a strongman; in exchange, obsolete practices honoring the royal family, such as prostration before the king, were revived. In the 1980s, Bhumibol appointed Gen. Prem Tinsulanonda as prime minister; Prem is now the head of Bhumibol’s privy council, where he fends off any attempts by the government to curtail royal prerogatives.

Bhumibol has exercised his clout with the army in ways that are widely perceived to have been in the nation’s general interest. During massive protests in 1992, he persuaded the unpopular prime minister of the day, Gen. Suchinda Kraprayoon, to step down. In 2006, after months of demonstrations against then-Prime Minister Thaksin Shinawatra, the king endorsed the coup that deposed him. And because his interventions have been periodic, though limited, Bhumibol is perceived as being above politics.

This would be a tough act to follow for anyone, but Crown Prince Maha Vajiralongkorn’s recent attempts to signal he is a worthy successor appear to be falling short.

In 1972, the king designated Vajiralongkorn, his only son, as heir to the throne, and under current succession law Parliament should simply ratify the king’s preference after his death. But for many years, the crown prince, now 62, showed little interest in royal affairs.

Vajiralongkorn spent much of his time in Munich, living a life some consider dissolute, for example taking nude photos of his wives and marking the death of his dog Foo Foo, which he had promoted to the rank of air marshal, with a lavish funeral. These eccentricities contrast with the squeaky-clean image of the king, and have not played well with either the people or the generals.

Despite holding many military titles, Vajiralongkorn lacks the support of the armed forces. Since 1978, he has maintained a vast praetorian guard. Supposedly in place to ensure his security and perform charitable works, it is seen as a counterforce to the official military.

For a time, Vajiralongkorn sought to boost his appeal by cultivating relations with Thaksin, who won elections in 2001 and 2005. But the strategy backfired.

In November 2013, during the protests against the government of Prime Minister Yingluck Shinawatra, Thaksin’s sister, Vajiralongkorn asked the bureau chief of the Metropolitan Police, a known confidant of Thaksin, to negotiate with the demonstrators. This only alienated them further — as did the prince’s decision, a few months later, to allow Thaksin supporters to camp outside one of his residences and to send his personal guard to protect Yingluck.

After Yingluck was ousted and the military took control in May 2014, Vajiralongkorn changed tack: He started reaching out to the new government of Prime Minister Prayuth Chan-ocha. (As the king’s designated heir, the crown prince’s accession should simply be endorsed by Parliament, but under military rule, the army’s support is also necessary.) In August 2014, Vajiralongkorn presided over the inauguration ceremony of the new military-appointed National Legislative Assembly, implicitly endorsing the coup. This March, he sent Prayuth flowers on his 61st birthday.

The prince also seems to have been cleaning house. He divorced his wife, Princess Srirasmi, in December, reportedly out of concern that her relatives had damaged the king’s dignity by exploiting his name for financial benefit. Her parents and brothers were later charged under Thailand’s draconian lese-majeste law, which applies to “whoever defames, insults or threatens the king, queen, heir-apparent or regent.”

It is unclear whether Vajiralongkorn’s efforts are paying off, but there are no realistic alternatives. One of Vajiralongkorn’s three sisters, Princess Maha Chakri Sirindhorn, is beloved of the people, thanks partly to her charitable activities. She is seen as humble and down to earth, much like her father. But current succession law and established practice do not readily allow her to accede to the throne.

The constitution was amended in 1974 to permit a daughter of the king to ascend the throne — but only in the absence of a male heir apparent and under other strict requirements. This presumably means that Sirindhorn could become queen only if Bhumibol demoted Vajiralongkorn and designated her as his new heir — which would be unprecedented. The king may already be too weak to make such a daring move, especially since it might shake the entire monarchy by triggering a power struggle between the conservative royalists who favor Sirindhorn, and the crown prince and his supporters.

It is possible that the military government, which is wary of Vajiralongkorn, could disregard the king’s preference and designate another candidate to the throne. But that decision would surely divide this already fragmented nation. It’s unlikely and the prince’s newfound behavior may bring a rapprochement with the military.

The monarchy remains a major political symbol in Thailand. But now, with the Bhumibol era in its twilight and a problematic succession ahead, the institution is weakened. Under these circumstances, Vajiralongkorn should be allowed to take the throne, as provided by law, but with the understanding that he will essentially forgo politics. Withdrawing is the royal family’s best chance of maintaining its moral authority, and it is Thailand’s best chance for some measure of stability.

Pavin Chachavalpongpun is an associate professor at Kyoto University’s Center for Southeast Asian Studies.