As many thousands of Hong Kong residents kept up their occupation of the streets Wednesday night, leaders on both sides began strategizing with an eye toward the endgame.

The pro-democracy protesters said they wouldn’t leave, and some of their leaders threatened to start occupying buildings on Thursday if their demands are not met.

The government — after an initial tough response with tear gas Sunday that only drew more demonstrators to the streets — has continued to lie low, apparently betting on the protesters losing steam and the public gradually turning against them in the absence of conflict.

On Wednesday, a holiday celebrating the Chinese Communist Party’s ascent to power, saw some of the biggest crowds yet in a public demonstration against Beijing’s political control — a demonstration that has scrambled calculations about the nature of Hong Kong’s self-rule.

Many were turning out for the first time — out of growing anger, out of a sense of civic responsibility or out of plain curiosity.

Hong Kong’s political fault line with Beijing

“I wanted my son to see for himself, this is what democracy looks like,” said Carman Mok, 46, his sixth-grade son in tow.

The organizers of the protests must find a way to keep the momentum on their side, against the risk that Hong Kong residents who showed up Wednesday will feel they have made their point and want to get back to their regular lives.

But at the same time, the patience shown by the authorities, including in Beijing, could quickly vanish if signs emerge that Hong Kong’s democratic fervor was spreading to the mainland.

An editorial read on China’s state broadcaster, CCTV, said Hong Kong residents should not interfere with efforts to deploy police “decisively” and to “restore the social order.”

The protesters are demanding that Hong Kong’s chief executive, Leung Chun-ying, resign and that Beijing back down on plans to vet candidates in Hong Kong elections. But not everyone on the streets agrees with the threat to escalate by occupying buildings. Up to now, the demonstrators have been punctilious about obeying the law.

For days, their loose organization has in many ways been their strength — bringing in far more numbers and support than previous incarnations run by distinct groups with formal leaders.

But as time drags on, that structure could make it harder to agree on a course of action, to enter into negotiations with the authorities and achieve tangible gains through compromise with the government.

“Right now, as protesters decide what to do next, decentralization is the weak link that Leung’s government can exploit to sow dissension,” said Willy Lam, an analyst at the Chinese University of Hong Kong.

Interviews with Hong Kong legislators, former officials and Leung advisers — as well as protesters — make it clear that Leung’s choice to wait is not just the logical step for him but one of the only things he can do.

Resorting to force seems unlikely not just from a public-relations perspective, but because the people on the streets vastly outnumber police ranks. Sending in the People’s Liberation Army would equally be a disaster, creating instant parallels to the Tiananmen Square crackdown of 1989.

A waiting strategy, however, has its own risks.

If the protests continue in large numbers for weeks or months, Chinese President Xi Jinping could look weak and open himself to criticism among party rivals that he has lost Hong Kong.

Already, China’s censors have been working overtime to keep images and news of the protest from reaching a Chinese audience, with some experts estimating the deleted posts on social media have reached record highs since Saturday.

CNN and other foreign news channels have gone black in China at the mere mention of Hong Kong.

And at least 20 people in China have been detained and 60 called in for questioning for posting online messages of support for the protest, Amnesty International said on Wednesday.

Over the past few years, China’s leaders have grown increasingly sophisticated in their response to protests — with tens of thousands of “mass incidents” occurring annually over land and environmental disputes, according to government statistics.

In some cases, leaders have waited out the protests. In others, they’ve cracked down with traditional force. With still others, they have appeased the local populace only to punish ringleaders months later.

With practice, Beijing’s leaders have grown savvier and more confident in their responses. Officials are even routinely sent to crisis management schools and PR classes.

Some in Hong Kong say dialogue is still possible.

Regina Ip, a pro-establishment legislator, said she’s trying to arrange a meeting of various factions within the protest movement.

“They can’t occupy the streets forever,” she said. “They can’t carry on doing this without any regard of public interest.”

On the other side of the spectrum, Emily Lau, a pro-democracy legislator, has urged discussions as well. “The kids are waiting to talk, so the government should seize that opportunity,” she said.

For such dialogue to take place, however, the former government chief secretary, Anson Chan, who remains an influential figure, said the government will need to make the first move.

“There’s so much anger right now,” she said. “The government needs to show sincerity, that it’s listening to the people’s views.”

Throughout Hong Kong, it was a day of jarring images and symbolism.

Leung began the morning sharing a champagne toast with other Chinese officials, in honor of the National Day holiday, while demonstrators nearby booed and jeered. Then, as China’s national anthem played, a group of student protesters turned their backs as a Chinese flag was raised and silently crossed their arms above their heads in a gesture of rejection.

A ceremony to honor Hong Kong war heroes was canceled. And an afternoon event at Victoria Park drew sparse attendance, even as large crowds began converging near government headquarters, the heart of demonstrations in recent days.

But the people of Hong Kong are not of one opinion.

All week long, Shan Cheung, 37, said she has watched the demonstrations unfold from her job in a nearby building. “It’s made me so sad. The goal is good, but this is not the way to achieve it,” she said.

As the demonstrations drag on, Shan said she fears all sides are facing a lose-lose scenario. Hong Kong’s government is losing credibility. Beijing is facing increasing pressure to crack down on the demonstrations. And in the end, she says, protesters will not get the overhauls they want.

Ishaan Tharoor in Hong Kong and Xu Jing in Beijing contributed to this report.