BEIJING — After months of relative restraint, China’s Communist government this week took its most decisive steps to intervene in Hong Kong’s political crisis, signaling a more forceful response that could further inflame tensions in the Chinese territory.

China’s top legislative body, the National People’s Congress, warned that it would use its authority, if necessary, to overrule the territory’s judiciary. It followed a Hong Kong court’s ruling on Monday overturning a contentious ban on wearing face masks, which protesters have used to shield their identities from the police.

The warning struck at the very heart of what has fueled the unrest, a concern about Beijing’s encroachment on Hong Kong . The protests began in June over another legal issue: legislation allowing the extradition of criminal defendants into the opaque and notoriously injudicious judicial system of the mainland.

While the bill has since been withdrawn, Beijing has not yielded an inch from its view that the Communist Party remains the ultimate arbiter of justice. That position is especially fraught for Hong Kong, where the court system has been a defining feature of the “one country, two systems” arrangement that promises the territory significant autonomy.