A man waves a rainbow flag outside the constitutional court in Taipei, Taiwan, in late March as it holds a debate on whether Taiwan should legalize same-sex marriage. (David Chang/European Pressphoto Agency)

TAIPEI, Taiwan — The gay rights activists raised sticks of incense and appealed to Taiwan’s most popular deity: Mazu, Goddess of the sea, protect us.

Or rather, Mazu, Goddess of the sea, protect us, too.

Just months ago, Taiwan appeared to be on the verge of legalizing same-sex marriage. It was to become the first country in Asia to do so, solidifying its status as a beacon for lesbian, gay, bisexual and transgender rights.

For years now, these islands have been at the forefront of Asia’s gay rights movement. While Singapore criminalizes gay sex and China cracks down on LGBT organizing, Taiwan has moved toward inclusion: Gays and lesbians serve openly in the military, textbooks extol equality, and Taipei’s annual gay-pride parade draws tens of thousands from across the region and around the world.

Taiwanese often credit this openness to Taiwan’s range of cultural influences, from indigenous groups to Dutch and Japanese colonizers, to seafaring settlers from the Chinese mainland — and their seafaring gods.

But the groundswell of support that spurred hope for marriage equality has spurred a bitter backlash that has experts and advocates wondering when or whether the law will move ahead.

Over the past year, mostly Christian community groups have mobilized against the marriage-equality movement, warning, contrary to evidence, that same-sex partnerships are a threat to children and that giving LGBT families legal protection will hurt Taiwan.

They have also claimed — again, contrary to evidence — that protecting the rights of gender and sexual minorities is a Western idea, that being gay is somehow not “Chinese.”

Taiwan’s gender and sexual minorities are now fighting harder than ever to remind Taiwan’s people — and government — that they, too, are Taiwanese, imbued with a full slate of rights and an equal stake in what “Chinese” and “Taiwanese” culture means.

So, on a recent spring morning, as they waited for news about a key verdict due next month, a small group gathered to seek support from Mazu, who comforts so many here.

“Please protect gay people and their children,” they said.

Taiwan’s gay rights movement was forged in the fight for democracy.

From the end of the Chinese civil war, in 1949, to 1987, the people of Taiwan lived under martial law, a period of political persecution now known as the “White Terror.”

Yu Mei-nu, the legislator behind Taiwan’s most recent marriage-equality bill, was one of the human rights lawyers who struggled against one-party rule. She helped revise laws to guarantee the rights of women and, in 1986, represented a gay man suing for the right to marry.

“Traditional culture is not a stone,” she said. “It changes.”

Taiwan has changed relatively quickly, thanks in part to coverage of touchstone cases.

In 2000, Taiwan was rocked by the apparent murder, at school, of a 15-year-old who was bullied for being effeminate. In the wake of the case, which was never resolved, the government adopted legislation designed to fight gender-based discrimination, starting in the classroom.

The legislation helped build grass-roots support for gay rights. In the run-up to the 2016 election, President Tsai Ing-wen’s campaign headquarters was awash in rainbows. She also published a Facebook message pledging full support for marriage equality.

“In the face of love, everyone is equal,” she said.

The video helped burnish her progressive credentials at home and turned her into a hero to LGBT people throughout the region. But as president she has been less publicly supportive of same-sex marriage, leaving some wondering where Taiwanese “tolerance” ends and full rights start.

Though only 5 percent of Taiwanese identify as Christians, well-funded and well-organized church groups have commandeered the conversation, primarily by playing on parental fear.

In recent months, concerned groups have reprised homophobic tropes about homosexuality, casting same-sex marriage as a gateway to incest, bestiality and AIDS. One group warned that new marriage laws could lead to a future where “it’s possible to marry a Ferris wheel.”

“Few say, ‘We don’t want to give gay people protection,’ but they focus on so-called family values, implying gay marriage will make mothers and fathers disappear, that schools will start teaching children to have sex,” said gay rights advocate Lin Shih-fang.

Realizing, perhaps, the power and limits of such rhetoric, the “anti” movement has broadened its messaging to focus on “traditional Chinese culture.”

At a hearing on marriage equality last month, Justice Minister Chiu Tai-san argued, in a court of law, that same-sex relationships are a “newly invented phenomenon” unlike “social norms and mechanisms formed by the people of our nation over the past thousand years” — leaving many people wondering what nation and norms he was referring to.

He also mused that same-sex marriage could complicate the rites of ancestor worship. “What are we going to write on the ancestral tablets if same-sex marriage is legalized?” he asked.

Victoria Hsu, a human rights lawyer who spoke at the same hearing, was shocked to hear the justice minister talk about tradition, not law. “He’s saying: ‘This is from Western culture. It’s not our tradition.’ But this is not something from the West, and it’s not about tradition — it’s about justice,” she said.

What worries activists is that some ostensibly pro-LGBT figures in government seem to have gone silent on the matter, talking about social division and the need for dialogue, rather than throwing their full weight behind the legislation.

At stake are the livelihoods of LGBT families who want legal protection, as well as Taiwan’s reputation as a regional leader on gay rights.

Jason Hsu, a lawmaker from the opposition Kuomintang, agreed that what happens will help define what it means to be Taiwanese now and shape Taiwan’s regional role in the years to come.

“There are some ways we can never compete with China, but this is a way we can compete, set a good example for them, use soft power,” he said, adding, “If Taiwan is to continue to be a beacon of liberty and democracy in Asia, these are the things that can really make us stand out.”

Like many who support marriage equality, he was frustrated by the backtracking, but he was confident Taiwan’s inclusive spirit would prevail.

“When we pass this law,” he said, “other nations in Asia will be watching.”

Emily Rauhala is China correspondent for The Washington Post. She was previously a Beijing-based correspondent for Time and an editor at the magazine's Hong Kong office. In 2017, she shared an Overseas Press Club award for a series about the Internet in China.