Hong Kong on Tuesday passed national security laws at the behest of Beijing, thwarting decades of public resistance in a move that critics say will strike a lasting blow to the partial autonomy the city had been promised by China.

The new legislation, which was passed with extraordinary speed, grants the authorities even more powers to crack down on opposition to Beijing and the Hong Kong government, establishing penalties — including life imprisonment — for political crimes such as treason and insurrection, which are vaguely defined. It also targets offenses such as "external interference” and the theft of state secrets, creating potential risks for multinational companies and international groups operating in the Asian financial center.

Analysts say the legislation, which will take effect March 23, could have a chilling effect on a wide range of people, including entrepreneurs, civil servants, lawyers, diplomats, journalists and academics, raising questions about Hong Kong’s status as an international city.