China has demanded that the United States stop spy plane flights near the Chinese coast, saying they have “severely harmed” trust, but the Pentagon insisted Wednesday it was within its rights.

The dispute comes after Taiwanese media reported two Chinese fighter jets attempted to scare off an American U2 reconnaissance plane that was collecting intelligence on China while flying along the Taiwan Strait in late June.

Beijing’s defence ministry said the US must end such flights, calling them a “major obstacle” as the two Pacific powers try to put a series of military disputes behind them, China’s state-run Global Times reported.

The flights “severely harmed” mutual trust, the paper quoted the ministry as saying.

“We demand that the US respects China’s sovereignty and security interests, and take concrete measures to boost a healthy and stable development of military relations,” it added. The defence ministry declined comment to AFP.