HONG KONG — An attempt by Beijing’s hand-selected chief executive in Hong Kong to push through a bill seen as a threat to civil liberties. A defiant crowd of hundreds of thousands marching against it. The deployment of the police to keep demonstrators out of the legislature.

It has been a tumultuous few days for Hong Kong. On Wednesday, the police fired tear gas and rubber bullets at a huge throng of protesters who forced lawmakers to postpone a debate on legislation to allow extraditions to mainland China — a measure Hong Kong residents fear would subject them to the Communist Party’s whims.

The legislation is being championed by Hong Kong’s current leader, Carrie Lam, a lifetime civil servant chosen two years ago by Beijing to head the territory. On Wednesday, she compared the protesters to spoiled children and vowed to keep fighting for the extradition law.

In standing firm, she is channeling the hard-line instincts of her boss, the Communist Party leader Xi Jinping, who has presided over a clampdown on civil society across China and essentially silenced all visible political dissent on the mainland.