China ordered the United States on Friday to close its consulate in the western city of Chengdu, ratcheting up a diplomatic conflict at a time when relations have sunk to their lowest level in decades.

The move was a response to the Trump administration's order this week for Beijing to close its consulate in Houston after Washington accused Chinese agents of trying to steal medical and other research in Texas.

The Chinese foreign ministry appealed to Washington to reverse its “wrong decision.”

The Chinese Consulate is shown Thursday, July 23, 2020, in Houston.  China says “malicious slander" is behind an order by the U.S. government to close its consulate in Houston,  and maintains that its officials have never operated outside ordinary diplomatic norms.  (AP PhotoDavid J. Phillip)

The Chinese Consulate is shown Thursday, July 23, 2020, in Houston. China says “malicious slander" is behind an order by the U.S. government to close its consulate in Houston, and maintains that its officials have never operated outside ordinary diplomatic norms. (AP PhotoDavid J. Phillip)

Chinese-U.S. relations have soured amid a mounting array of conflicts including trade, the handling of the coronavirus pandemic, technology, spying accusations, Hong Kong and allegations of abuses against Chinese ethnic Muslims.

“The measure taken by China is a legitimate and necessary response to the unjustified act by the United States,” said a foreign ministry statement.

“The current situation in Chinese-U.S. relations is not what China desires to see. The United States is responsible for all this,” the ministry said. “We once again urge the United States to immediately retract its wrong decision and create necessary conditions for bringing the bilateral relationship back on track.”

A security guard, right, talks with a man inside the Chinese Consulate Thursday, July 23, 2020, in Houston.  China says “malicious slander" is behind an order by the U.S. government to close its consulate in Houston,  and maintains that its officials have never operated outside ordinary diplomatic norms. (AP PhotoDavid J. Phillip)

A security guard, right, talks with a man inside the Chinese Consulate Thursday, July 23, 2020, in Houston. China says “malicious slander" is behind an order by the U.S. government to close its consulate in Houston, and maintains that its officials have never operated outside ordinary diplomatic norms. (AP PhotoDavid J. Phillip)

On Tuesday, the Trump administration ordered the Houston consulate closed within 72 hours. It alleged Chinese agents tried to steal data from facilities including the Texas A&M medical system.

The ministry on Thursday rejected the allegations as “malicious slander” and warned the Houston consulate's closure was “breaking down the bridge of friendship” between the two countries.

The United States has an embassy in Beijing and consulates in five other mainland cities — Shanghai, Guangzhou, Chengdu, Shenyang and Wuhan. It also has a consulate in Hong Kong, a Chinese territory.

FILE - In this Sept. 16, 2018, file photo, American flags are displayed together with Chinese flags on top of a trishaw in Beijing. On Friday, July 24, 2020, China has ordered the United States to close its consulate in the western city of Chengdu in an increasingly rancorous diplomatic conflict. The order followed the U.S. closure of the Chinese consulate in Houston.  (AP PhotoAndy Wong, File)

FILE - In this Sept. 16, 2018, file photo, American flags are displayed together with Chinese flags on top of a trishaw in Beijing. On Friday, July 24, 2020, China has ordered the United States to close its consulate in the western city of Chengdu in an increasingly rancorous diplomatic conflict. The order followed the U.S. closure of the Chinese consulate in Houston. (AP PhotoAndy Wong, File)