HONG KONG — Hong Kong’s national security law imposed by Beijing last week was not “doom and gloom” for the city, its leader Carrie Lam said on Tuesday, adding it was untrue to say she was not privy to any of its details before they were announced.

The sweeping legislation punishes what China describes broadly as secession, subversion, terrorism and collusion with foreign forces, with up to life in prison.

It came into force at the same time it was made public just before midnight last Tuesday, with police arresting about 10 people for related offences the next day.

Speaking at her regular weekly news conference, Ms. Lam said she knew some details of the legislation before it was made public, but she had not seen the complete draft. She said the law would restore Hong Kong’s status as one of the safest cities in the world after sometimes violent pro-democracy protests last year.

“Compared with the national security laws of other countries, it is a rather mild law. Its scope is not as broad as that in other countries and even China,” Ms. Lam said, without naming the countries.

The legislation has been criticized by nations such as Britain and the United States, and rights groups, for undermining freedoms guaranteed under the “one country, two systems” agreed as part of the former British colony’s return to Chinese rule in 1997, and for giving mainland security agencies an enforcement presence in Hong Kong for the first time.

Its final power of interpretation lies with authorities in mainland China, where human rights groups have reported arbitrary detentions and disappearances. China has been clamping down on dissent and tightening censorship.

Both Hong Kong and Chinese government officials have said the law was vital to plug gaping holes in national security defenses, exposed by the city’s failure to pass such laws by itself as required under its mini-constitution, the Basic Law.

Ms. Lam said cases involving the new mainland agency in Hong Kong will be “rare” and that national security was a “red line” that should not be crossed.

If reporters in Hong Kong could guarantee they would not breach the new law, she could guarantee they would be allowed to report freely in the city, Ms. Lam said.

Late on Monday, Hong Kong released additional details of the law, saying security forces had overriding authority to enter and search properties for evidence and stop people from leaving the city. — Reuters