Authorities in Hong Kong, at least for the moment, have lost control of spiraling protests in the city. Although the government said Monday it had pulled back riot police, Chinese state media reported that Beijing is prepared to send the People’s Armed Police, essentially a branch of the military, to Hong Kong to restore order, and some observers say martial law could soon be imposed. Others worry that police might resort to deadly force against protesters.

The deteriorating situation must make the Communist Party in China nervous, especially because of what’s known as “democracy contagion”: If the people in Hong Kong can vote in meaningful elections, then citizens throughout an increasingly wired China will demand the same. Already, a few protesters in Shanghai’s People’s Square, in the center of that city, are passing around a photo of themselves on Chinese social media showing their support for the students in Hong Kong. And in a written statement, they are also asking for the vote for themselves.

On Monday in Hong Kong, confrontations between police and protesters continued after Sunday’s series of showdowns. Over the weekend, police fired tear gas and charged crowds with batons as perhaps as many as 60,000 students and other residents took to the streets to demand fair elections. Demonstrators gathered around government buildings and other landmarks in the Central and Admiralty districts, in the heart of the city. Protests spread late Sunday evening, when people in other areas began erecting barricades and gathering in intersections.

Disturbances continued into the early hours of Monday as crowds grew in outlying districts, in both the Causeway Bay tourist area of Hong Kong island and in Kowloon’s Mong Kok.

Students are expected to continue their week-old boycott on Monday, and teachers appear set to join them, as may other groups. There are now calls for a general strike. Some schools will close for at least the day, and businesses are telling employees to stay home.

This spring, the protests of the last few days were inconceivable. The “pan-democracy” movement, as it is sometimes called, looked to be on its last legs. Then, on June 10, Beijing issued its “white paper” on governance of Hong Kong, one of the two Special Administrative Regions of the People’s Republic of China. Instead of affirming the city’s autonomy, the Chinese government declared it had the authority to take back what people in Hong Kong considered to be their rights.

As a result of Beijing’s hard-line position, hundreds of thousands of Hong Kong residents—approaching a half-million of them—participated in the annual July 1 democracy march.

Unmoved, Beijing then followed up its stark June 10 declaration with its proposal, issued on August 31, for the 2017 election of Hong Kong’s chief executive, the city’s top political official. Although the Chinese plan provided for universal suffrage, a first for Hong Kong, it included a nominating procedure so restrictive that only the Communist Party’s hand-picked candidates could stand for election.

Established activists, who had earlier threatened to shut down the city’s main business district with peaceful sit-ins, seemed to fold in the face of Beijing’s intransigence. Chan Kin-man, a co-founder of the Occupy Central group, signaled the defeat of the pan-democrats by announcing on September 2 that the movement was “close to failure.”

But younger Hong Kong residents rushed to fill the void and started a series of protests. Last Monday, university students began a boycott of classes. On Tuesday, they swarmed toward Leung Chun-ying, the serving chief executive, at the government’s headquarters. On Wednesday, they marched to Central, the main business and financial district of the city, without the required police authorization. On Friday, secondary school children joined the boycott.

In this weekend’s protests, the police overreacted and created sympathy for the students. Televised images of the police gassing protesters prompted ordinary residents to leave their homes and join them in the streets. Michelle Chow, for one, said she was stunned that police used violence against students who held their hands above their heads in a show of peaceful intent. “The government must be scared if it uses such irrational force,” the 53-year-old told the South China Morning Post.

The demonstrations in Hong Kong are undoubtedly affecting an already turbulent Beijing. Xi Jinping, seeking to consolidate power, has a personal stake in the outcome of the struggle in the streets, as he held the portfolio for Hong Kong from 2007 until assuming the presidency last year. Given Xi’s personal involvement, it is not surprising that Chief Executive Leung failed to convey the depth of feeling in the city over the 2017 election. It appears that no official, either in Hong Kong or China, was willing to tell Beijing that Xi’s policy was a failure.

Xi’s general approach toward internal dissidents—be they Tibetans, Uighurs, Christians, or democracy advocates—has been ruthless, and Beijing’s recent unyielding stance toward Hong Kong suggests his continued involvement in its affairs. That means the protests could shake the Chinese political system. As Arthur Waldron of the University of Pennsylvania noted today, “If Xi fails this, his whole future is in question.”

Given the stakes, some in Hong Kong believe China will move soon. There are rumors that the People’s Liberation Army is massing in Shenzhen, just to the north of Hong Kong.

Those who foresee a harsh response point to the sudden change in the leadership of the PLA’s 6,000-strong Hong Kong garrison in July. Just two weeks after the unexpectedly large turnout for the annual democracy march, Beijing replaced Maj. Gen. Liu Xiaojun, just two years into his four-year term, and gave him a largely ceremonial position in the Guangzhou Military Region. Russian-trained Maj. Gen. Tan Benhong took over.

For many, it is impossible to believe Chinese troops would march on the city, but at this moment almost anything can happen, especially as the protests are taking on an anti-China taint. Students now say they will not salute the Chinese flag if it is raised in schools on Monday, and protesters on Sunday chanted anti-Beijing slogans.

If the disturbances continue into the early part of this week and the Hong Kong police are unable to restore order, Xi Jinping may feel he has no choice but to strike hard. As Chan Kin-man, the Occupy Central co-founder, said as he urged protesters to go home late Sunday evening, “It is a matter of life and death.”