Image copyright Reuters Image caption Included in the law is the move to make key network infrastructure and information systems "secure and controllable"

China's legislature has passed a wide-ranging and controversial national security law which tightens government control over many areas of life.

The law broadly defines national security as covering everything from finance and cyber security to religion.

State media said it would "protect people's fundamental interests".

It is part of a raft of policies by President Xi Jinping that have drawn criticism from foreign governments, businesses and rights groups.

'Severe' threats

The vaguely worded legislation authorises the government to take "all necessary" steps to protect China's sovereignty.

Included in the law, passed by the standing committee of the rubberstamp National People's Congress, is a move to make key network infrastructure and information systems "secure and controllable".

Image copyright Reuters Image caption The government says it will enable the authorities to take all the necessary steps to safeguard the country's internet infrastructure

The BBC's Martin Patience in Beijing says critics argue the law is excessive.

Many foreign technology firms operating in China are concerned, he adds. They fear that under the new law they will be forced to hand over sensitive information to the authorities.

The law is more an ideological declaration, says Zhang Xuezhong, a lawyer and former professor at East China University of Political Science and Law, which will allow more cultural censorship and a crackdown on dissidents.

"A good security law should state who on what conditions gets what punishment, but this law doesn't," Mr Zhang says.

"Technically speaking, the law is awful, as it is difficult to enforce it on individuals and companies."

'Legitimate rights'

Speaking at a news briefing in Beijing, a senior party official, Zheng Shuna, said the law was necessary because China's national security situation had "become increasingly severe", the Xinhua news agency reports.

She said China had to defend its sovereignty and interests while also maintaining its political and social stability.

"We will continue to follow the path of peaceful development but we absolutely will not give up our legitimate rights and absolutely will not sacrifice the country's core interests," she said.

The tightening of security laws comes amid tensions with its neighbours over competing territorial claims in the South China and East China Seas.

President Xi, who is head of the recently formed National Security Commission, has previously said China's security covers a wide range of areas including culture, politics, military, the economy, technology and the environment.