HONG KONG — Hong Kong was paralyzed for a third consecutive day Wednesday as pro-democracy protesters dug in and authorities clamped down harder after chaotic battles between riot police and student activists the previous night left a university campus resembling a combat zone.

Bus routes, train services and major roads were shut down Wednesday, as a general strike called in response to the death of a young demonstrator brought more chaos for commuters. Students from mainland China and elsewhere began to evacuate the city because of the intensifying political unrest.

Education officials said all classes would be suspended Thursday, and some universities canceled programs until the end of the semester. By nightfall, protesters resumed setting up barricades and roadblocks in preparation for fresh confrontations with riot police.

The rapidly deteriorating situation has fueled fears of major intervention by the Chinese government. Beijing has backed the authorities in Hong Kong, a semiautonomous Chinese territory and one of the world’s major financial centers, in increasing repression to try to squelch the unrest. Front-line protesters have responded by escalating their actions against police.

On Wednesday, China’s Foreign Ministry reiterated that Beijing would not compromise with demonstrators, who are demanding full democracy for Hong Kong and an independent inquiry into what they say is police brutality during more than five months of clashes.

“Hong Kong’s problem is not about human rights or democracy; rather, it’s about stopping violence and chaos, restoring order,” Foreign Ministry spokesman Geng Shuang said at a regular news briefing. Chinese state media condemned the protesters as “black-clad rioters” who are endangering lives.

At the Chinese University, one of Hong Kong’s top tertiary institutions, there was welcome respite Wednesday after clashes overnight in which riot police fired 2,000 rounds of tear gas and rubber bullets as they tried to storm the campus but were beaten back by protesters armed with gasoline bombs and bricks.

Police expressed suspicion Wednesday that the Chinese University had become a “weapons factory.” The university said it condemns the violence, noting that a number of students have been injured.

With classes suspended, some students took the opportunity to leave Hong Kong. The Chinese government’s Hong Kong liaison office, which represents Beijing’s interests, set up a hotline to help students trying to get back across the border.

The Marine Police used a patrol launch to evacuate students who were from mainland China. All train and bus routes to the Chinese University were closed, and surrounding roads were blocked.

“My parents wanted me to leave and get out of Hong Kong,” Yuki, 19, a student from China’s Hubei province, said as she left for the mainland city of Shenzhen. Although she was unsettled by protesters’ vandalizing of pro-government businesses, she knew she would be safe if she stayed out of their way, Yuki said. She said she plans to return when classes resume.

Jay Thuluri, a Chinese University exchange student from Babson College in Wellesley, Mass., said he plans to return to the United States on Thursday after his parents told him to get out.

“I came here to study,” he said. “Now I cannot study because school is suspended. There is no point for me to stay here with the potential of dangerous situations.”

On Swedish public radio, some universities called on their students in Hong Kong to return home. Some Taiwanese students also have left the territory. The State Department said it continues to maintain a travel advisory for Americans to exercise “increased caution” in Hong Kong.

At Hong Kong Baptist University, dozens of protesters erected barricades at road junctions around the campus, using street barriers, bricks and scaffolding.

A 24-year-old woman who gave her name only as K, citing a fear of reprisals, said the police had “crossed the line” by storming the Chinese University.

“Campus is supposed to be one of the safest places,” she said. “The [Chinese] University is a symbol of liberty and democracy, and they are trying to attack it. That’s why students are trying so hard to defend it.”

Late Wednesday, a court rejected a request from the university’s student union for an injunction to prevent police from entering the campus without a warrant.

In the central business district, office workers occupied downtown streets during their lunch breaks Wednesday, chanting “Save our students!” and cheering front-line protesters who faced down riot police. As the narrow streets filled with tear gas fired by police, hundreds ran away coughing, while dozens were subdued on the doorsteps of luxury shops.

Protesters are pushing back against Beijing’s increasing encroachment on Hong Kong’s freedom and autonomy, which China promised to maintain until 2047 under a 1997 agreement with Britain that gave Beijing sovereignty over what had been a British colony.

Along with other demands, protesters are calling for the right to elect Hong Kong’s leader, who at present is appointed by a committee largely made up of pro-Beijing establishment figures.

The current chief executive, Carrie Lam, has withdrawn a legislative bill that would have allowed extraditions to mainland China — the initial spark for the unrest. But she has refused demands for political liberalization and an independent inquiry into police use of force, instead urging people to wait for the results of an investigation by a police watchdog with limited powers.

“We want to choose a true chief executive for the Hong Kong people,” said office worker Dennis Tang, 25. “In these five months, Carrie Lam has pushed Hong Kong to hell and has used the police as a tool to suppress the people.”

The unrest poses a direct challenge to Chinese leader Xi Jinping. The Chinese government has accused foreign powers, particularly the United States and Britain, of fomenting the unrest.

Sonny Lo, a political analyst and expert on Hong Kong-China relations, said Hong Kong faces a “system failure” and needs intermediaries, such as university chiefs, to sit down with government leaders and find a solution.

“Beijing says its bottom line is ‘all this violence has to stop.’ It’s up to the Hong Kong government leadership itself to design measures [in response], but all the measures have been so hard-line,” he said. There need to be “carrots” as well as a “stick,” he said.

Liu Yang in Beijing contributed to this report.