China passed a law on Saturday to strengthen border protection amid a protracted standoff with India, worries about spillover effects from Taliban-controlled Afghanistan and the spread of Covid-19 from Southeast Asia.
The Land Borders Law will not necessarily change how border security is handled when the measure takes effect on Jan. 1, but it reflects China's growing confidence in its capability to manage its frontiers.
China has been closely watching neighbouring Afghanistan, where the Taliban returned to power in August, to guard against a possible inflow of refugees or Islamic extremists crossing over to link up with the Muslim Uyghurs in China's Xinjiang region.
At its Himalayan frontier, Chinese soldiers have been in a standoff with Indian troops since April 2020.
China has also taken great pains to keep the Covid-19 virus outside of its borders, after illegal crossings from Myanmar and Vietnam contributed this year to a surge in cases in its southern provinces of Yunnan and Guangxi respectively.
This is the first time that the People's Republic of China, founded 72 years ago, has a dedicated law specifying how it governs and guards its 22,000-km (14,000-mile) land border shared with 14 countries, including former superpower Russia and nuclear-capable North Korea.
The country will "take effective measures to resolutely protect territorial sovereignty and land border security", the law says.
Chinese military and military police - the People's Liberation Army and the People's Armed Police Force - are responsible for guarding the border against any "invasion, encroachment, infiltration, provocation".
The law stipulates that China can close its border if a war or other armed conflict nearby threatens border security.