The US State Department warned American travelers on Thursday that they could face arbitrary action by the authorities, including an exit ban, when they visit China, following the detention of two Canadians.

In an updated travel advisory, the department said Americans should “exercise increased caution” in China. However, it stopped short of discouraging travel to China, America’s trade war adversary.

The department warned of “arbitrary enforcement of local laws,” sudden prohibitions on exiting the country and harassment of US citizens of Chinese heritage.

“In most cases, US citizens only become aware of the exit ban when they attempt to depart China, and there is no method to find out how long the ban may continue,” it said.

“US citizens under exit bans have been harassed and threatened.”

It also warned of last-minute security checks and curfews in Xinjiang and Tibet, two minority-dominated regions where Beijing has tightened its grip.

China last month detained two Canadians, a former diplomat and a businessman, on charges of activities that “endanger China’s security.”

The move was widely seen as retaliation after Canada arrested an executive of telecom giant Huawei at the request of the United States, which said she violated Washington’s sanctions on Iran.

– with reporting by Agence France-Presse