HONG KONG—Street battles raged across Hong Kong and the city’s subway operator suspended its entire network late Friday as the government’s move to invoke emergency measures and ban people from wearing masks at protests triggered a backlash.

The city’s leader, Chief Executive Carrie Lam, invoked the British colonial-era law for the first time in 52 years, saying it was a deterrent to social unrest that posed a serious public danger. The ban on people wearing masks at public gatherings and unlawful assemblies would be punishable...