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

Earlier this week, the government of Thailand ordered Facebook to block access to a private group on the social media platform. The group, called Royalists Marketplace, boasted more than 1 million members, who joined it to share their concerns about the unrestricted political power of the Thai monarchy. I know quite a lot about the group — because I’m the one who set it up.

Facebook says that it has an obligation to follow the laws of the countries in which it operates — and Thailand’s harsh lèse-majesté law forbids even the slightest criticism of the royal family. Yet within hours of closing down Royalists Marketplace, Facebook announced it was planning to sue the government in Bangkok for infringing upon the rights of the company’s users to express their views. At stake in this legal battle is nothing less than the fate of democracy in a country where the monarchy holds the ultimate power.

On the evening of Aug. 24, I received a FaceTime call at my home in Japan from Facebook representatives, who informed me that they were about to block access to Royalists Marketplace in Thailand at the government’s request. I was furious, and I upbraided them for enabling a regime that is bent on sabotaging any hint of democratization in my country. At 11 p.m. Bangkok time, Royalists Marketplace disappeared from Thai cyberspace.

Several hours later, I woke up to breaking news: Facebook had changed its position, saying now that it wanted to sue the Thai government. Of the government’s order the company said, in part: “Requests like this are severe, contravene international human rights law, and have a chilling effect on people’s ability to express themselves.”

I had set up Royalists Marketplace on April 16 to serve as a platform for serious discussion of the role of the monarchy. The Thai monarchy plays a crucial role in our political system. Yet the lèse-majesté law punishes vaguely defined “insults” to royal family with prison terms of up to 15 years.

Over the next four months, Royalists Marketplace quickly opened up a public space for critical comments about King Vajiralongkorn (officially known as King Rama X) and his family. In August, its members surpassed 1 million, making it the 18th-largest Facebook group in the world. The military-backed government, which depends on its symbiotic relationship with the king, realized that it was facing a serious threat.

What particularly worried the government is that most of the group’s members are young people. I have to admit that I’m pleasantly surprised by the younger generation’s passionate interest in the political role of the monarchy. They’ve somehow managed to transcend years of state propaganda designed to extol the monarchy and demand the people’s unconditional love. By the time these Thais became teenagers, the much-revered King Bhumibol Adulyadej was bedridden. He passed away in October 2016, leaving a gigantic hole.

The enthronement of the controversial Vajiralongkorn, Bhumibol’s son, has eroded reverence for the monarchy, prompting the younger generation to contest his legitimacy. Royalists Marketplace happened to appear at this critical juncture in our politics. Its members used the group to voice their frustration with the monarchy and to question the political role of the king, including his intimate relationship with the military, his super-rich status, and his involvement in the abductions and killings of Thai dissidents overseas.

Now they have gone out on the streets to demand immediate reform of the monarchy, hoping to reassert constitutional limits on its role. That has led the government to arrest core student leaders and seek cooperation from Facebook to censor my group.

While the shift of Facebook’s position is much to be commended, it reflects the company’s inconsistent position on democracy and free speech. Facebook has been criticized in the past for cooperating with dictatorial regimes in suppressing freedom of expression. Indeed, it continues to accept the requests of the Thai government to take down numerous posts critical of the monarchy, including mine.

The correct position should be clear. As the world’s largest social media platform, Facebook has an utmost responsibility to uphold the right of free speech and support democratization worldwide, not just in Thailand. All too often, though, it seems that the company’s concern for its bottom line overrides its respect for free speech.

It remains to be seen just how serious the company is about its legal action against Thailand. The whole episode has evidently put such pressure on the monarchy that the prime minister, General Prayuth Chan-ocha, felt compelled to attack me by name on television.

As soon as the group was blocked in Thailand, I set up a new one with a similar name. Within 48 hours it had welcomed almost 800,000 members.

Young people in Thailand are fighting like never before for their right to information about the politics of their own country. The monarchy, as an archaic institution, has long defied the reality of the 21st century. Social media is a significant catalyst for change. Either it will help the monarchy to catch up with modernity — or it will hasten the monarchy’s destruction if it refuses to reform.

Read more: