HONG KONG — Protesters resisting China's tightening grip over Hong Kong gathered Wednesday in defiance of thousands of riot police who locked down parts of the city and barricaded the legislature, where Beijing's allies pushed a bill to criminalize disrespect of China's national anthem.

The heavy police presence and arrests of more than 300 people, many of whom appeared to be simply shouting slogans, reflected a deepening level of dissent in the city and authorities' determination to stamp it out by force.

With Hong Kong's role as a global financial center increasingly clouded, Chinese President Xi Jinping is escalating a crackdown and advancing plans to end the strife-torn city's autonomy and hasten its full integration into China.

Beijing's rapid moves in Hong Kong have been denounced by the United States and allies, but Washington took its first clear diplomatic steps Wednesday.

Secretary of State Mike Pompeo notified Congress that Hong Kong no longer should be considered autonomous, a declaration that could have far-reaching ramifications in its trading relationship with the United States and could lead to other U.S. actions including sanctions.

Under a law passed by Congress last year, Pompeo was required to issue a determination on Hong Kong's autonomy. "No reasonable person can assert today that Hong Kong maintains a high degree of autonomy from China, given facts on the ground," Pompeo said in a statement.

In Hong Kong, preemptive arrests of democracy activists, stop-and-search inspections of passersby and the tight security presence helped authorities mostly stave off planned large-scale rallies Wednesday. Yet public fury continued to build over the anthem bill and, most notably, Beijing's plans to impose a far-reaching national security law on the former British colony.

By afternoon, protests flared in the main business district as office workers and young protesters shouted "Free Hong Kong!" and slurs at riot police, who responded by shooting pepper spray and pepper-ball projectiles, leaving demonstrators and other people choking on the sidewalks.

New protest slogans — "Hong Kong, build our nation!" and "Independence, the only way out!" — suggested that Beijing's repression is shifting attitudes toward Hong Kong independence, until recently considered a fringe viewpoint.

Protesters have been galvanized by fears that their freedom to demonstrate, voice critical opinions and exercise other rights theoretically guaranteed by Hong Kong's constitution will soon be eliminated. China's rubber-stamp legislature last week announced that it would bypass Hong Kong's political system and impose by decree the new security law, which would criminalize secessionist activities, "foreign interference" and subversion of the state.

China’s Foreign Ministry has said the law is necessary to safeguard Hong Kong’s security and has bristled at what it perceives as foreign influence behind the political unrest. A ministry spokesman said Wednesday that the legislation pertaining to Hong Kong — where hundreds of U.S. and multinational corporations have regional offices — was purely China’s internal affair.

Many in Hong Kong worry that these vaguely defined measures will be a catchall to quash dissent. Months of street protests last year were similarly driven by fear about Beijing’s encroachment on the city’s autonomy, which was supposed to be guaranteed under its 1997 handover from Britain to China. U.S. lawmakers have responded to Beijing’s incursions with calls for sanctions against Chinese officials and banks.

The national anthem bill, which was pushed through after Beijing tightened its grip on the legislature, has further galvanized protesters.

Communist Party officials have long viewed Hong Kong, with its distinct culture and political history, as insufficiently loyal toward the “motherland” — soccer fans here routinely boo the Chinese anthem at games, for instance — and have urged measures to instill more patriotism, including through the school curriculum. Protesters last year composed their own anthem for Hong Kong, which is now performed and played all over the city.

The anthem bill would impose penalties of up to three years in prison and fines of about $6,500 on anyone in Hong Kong who mocks or disrespects China’s official national song, “March of the Volunteers.”

South China Morning Post

“The use of laws and penalties to force people to love their country is doomed to fail,” pro-democracy lawmaker Ray Chan said in a debate about the bill. “Respect goes two ways. A dictatorship is not qualified to ask its people to respect it.”

Ahead of the legislative session Wednesday, Hong Kong police by daybreak had fortified roads, parks, walkways and office buildings, making it impossible for protesters to get near the legislative complex. Pro-democracy unions had called for their members to go on strike, while some students planned to skip school just days after classes resumed following the coronavirus outbreak.

In a statement on Facebook, police warned “thugs not to try and challenge the rule of law in Hong Kong.” Police said later that more than 300 people had been arrested for weapons possession, unlawful assembly and other charges.

“It is as if Xi Jinping is ruling our city by himself!” an elderly woman shouted at police officers who told her to keep walking down a pedestrian bridge, in one of several tense exchanges. Others joined in to shout slurs at the police, while groups of young men were patted down and searched nearby.

Later, hundreds gathered in the shopping district of Causeway Bay and in the central financial district, shouting protest slogans, and then in the Mong Kok district on Kowloon, where they briefly occupied a key road. Police rushed at crowds of dissenters, sometimes firing pepper spray and pepper balls. As police left, groups would reassemble and continue shouting at the officers.

Officers made arrests around the city, forcing groups of teenagers, elderly men and women, and white-collar workers up against walls before searching them and shepherding them, handcuffed, onto buses.

Hong Kong officials have lined up to support Beijing’s effort to pass the national security measure, which China’s legislature is expected to approve on Thursday. The bill will then be forwarded to China’s top legislative body, the Standing Committee of the National People’s Congress, to craft in detail.

“We are a very free society, so for the time being people have this freedom to say whatever they want to say,” Hong Kong Chief Executive Carrie Lam said in a news conference Tuesday. The legislation, she said, will ensure that “Hong Kong’s freedoms will be preserved.”

Beijing’s moves on Hong Kong have angered China hawks in Washington, who have called for sanctions against people who curtail the territory’s freedoms and for an end to the special relationship between Hong Kong and the United States.

President Trump said Tuesday that his administration is planning to announce a strong response to China on Hong Kong this week.

Tiffany Liang and Timothy McLaughlin in Hong Kong and Carol Morello in Washington contributed to this report.