China has passed a law that for the first time explicitly allows its coast guard to fire on foreign vessels, a move that could make the contested waters around the country more choppy.

China has maritime sovereignty disputes with Japan in the East China Sea and with several southeast Asian countries in the South China Sea.

It has sent its coast guard to chase away fishing vessels from other countries, sometimes resulting in the sinking of these vessels.

China's top legislative body, the National People's Congress standing committee, passed the Coast Guard Law today, according to state media reports.

The coast guard is allowed to use "all necessary means" to stop or prevent threats from foreign vessels, according to the draft wording in the bill published earlier,

The bill specifies the circumstances under which different kind of weapons - hand-held, ship borne or airborne - can be used.

The bill allows coast guard personnel to demolish other countries' structures built on Chinese-claimed reefs and to board and inspect foreign vessels in waters claimed by China.

The bill also empowers the coastguard to create temporary exclusion zones "as needed" to stop other vessels and personnel from entering.

Responding to concerns, Chinese foreign ministry spokeswoman Hua Chunying said that the law is in line with international practices.

The first article of the bill explains that the law is needed to safeguard China's sovereignty, security and maritime rights.

This law comes seven years after China merged several civilian maritime law-enforcement agencies to form a coast guard bureau.

After the bureau came under the command of the People's Armed Police in 2018, it became a proper branch of the military forces.