China has passed a bill that allows its coast guard to use weapons when foreign ships involved in illegal activities in waters claimed by the country fail to obey orders, state-run media reported, in a move that would complicate relations with Japan.

As Beijing claims that the Senkaku Islands, administered by Tokyo in the East China Sea, are part of its territory, the legislation could target Japanese vessels navigating around the uninhabited islets, which are known in China as the Diaoyu.

Chinese ships have been frequently spotted in the so-called contiguous zone outside Japanese waters, with President Xi Jinping's leadership adopting a hard-line posture on the isles under its goal of making the nation a "maritime power."