The U.S. State Department has issued a fresh travel warning advising Americans against heading to China over selective enforcement of local laws and the "risk of wrongful detentions." 

The warning comes nearly two months after China sentenced a 78-year-old U.S. citizen to life in prison over spying charges. 

"The People’s Republic of China (PRC) government arbitrarily enforces local laws, including issuing exit bans on U.S. citizens and citizens of other countries, without fair and transparent process under the law," the State Department says. 

"U.S. citizens traveling or residing in the PRC may be detained without access to U.S. consular services or information about their alleged crime," it added, noting that "Foreigners in the PRC, including but not limited to businesspeople, former foreign-government personnel, academics, relatives of PRC citizens involved in legal disputes, and journalists have been interrogated and detained by PRC officials for alleged violations of PRC national security laws." 

CHINA SENTENCES US CITIZEN, 78, TO LIFE IN PRISON ON SPYING CHARGES 

Tiananmen Square in Beijing

Chinese national flags flutter at Tiananmen Square on March 10, 2023, in Beijing. (VCG via Getty Images)

The State Department is also telling Americans to watch out for so-called "exit bans" restricting travel away from China once inside its borders. 

Beijing has used those bans, it says, to coerce people into participating in government investigations, "pressure family members of the restricted individual to return to the PRC from abroad" or "gain bargaining leverage over foreign governments," according to the State Department. 

In May, John Shing-Wan Leung, who also holds permanent residency in Hong Kong, was sentenced to life in prison over alleged spying charges. 

CHINA’S UPDATED COUNTERESPIONAGE LAW IS ‘DIRECT ATTACK’ ON US CITIZENS, BUSINESSES: SEN. MARKWAYNE MULLIN

People wait in line for COVID tests in China

Chinese citizens wait in line for COVID testing on June 20, 2022, in Macau, one of the regions the U.S. State Department is telling Americans to avoid. (Reuters/John Mak)

Leung was detained on April 15, 2021, by the local bureau of China's counterintelligence agency in the southeastern city of Suzhou, the city’s intermediate court said in a statement at the time. 

Details of the charges have not been publicly released. 

The U.S. Embassy in Beijing told the AP it was aware of the case, but could not comment further because of privacy concerns. 

"The Department of State has no greater priority than the safety and security of U.S. citizens overseas," the embassy said in an email. 

Hong Kong skyline

The U.S. is telling Americans to exercise increased caution when traveling to China "due to the arbitrary enforcement of local laws." (Li Zhihua/China News Service/VCG via Getty Images)

CLICK HERE TO GET THE FOX NEWS APP 

The State Department said in its travel advisory that "PRC authorities appear to have broad discretion to deem a wide range of documents, data, statistics, or materials as state secrets and to detain and prosecute foreign nationals for alleged espionage." 

It also says Americans should exercise increased caution when traveling to Hong Kong and reconsider travel to Macau due to arbitrary enforcement of local laws there as well. 

Fox News’ Landon Mion and The Associated Press contributed to this report.