BEIJING (Reuters) - Territorial disputes between China and the Philippines may take a lifetime to resolve but should not prevent warming ties, the Philippine foreign secretary said on Wednesday, as President Rodrigo Duterte seeks to mend relations on a visit to China.

Duterte arrived in Beijing on Tuesday with at least 200 top business people to pave the way for what he calls a new commercial alliance, amid deteriorating ties with longtime ally the United States.

Foreign Secretary Perfecto Yasay's remarks in China came as Philippine police used teargas to disperse about 1,000 anti-U.S. protesters outside the U.S. embassy in Manila.

Speaking to the Philippine delegation at a Beijing hotel, Yasay said disputes with China over rival claims in the South China Sea could take many years or even a "lifetime" to resolve.

"But this should not be an impediment or a barrier in fostering our closer ties with each other," Yasay said, referring to China.

Yasay reiterated that the thaw with China was "not going to erode our close ties with the rest of our allies and traditional partners".

"As we renew our ties with this great nation, it does not mean that we are weakening ties with the rest of the members of the international community. This is at the core of the independent foreign policy that our president has moved and put forward," he said.

The effort to engage China, months after a Hague ruling over South China Sea disputes in favour of the Philippines, marks a reversal in Philippine foreign policy since Duterte took office on June 30.

China has welcomed the shift in tone that has added to strains between the Philippines and the United States, even as Duterte has vowed not to surrender any sovereignty to Beijing, which views the maritime ruling as null and void.

In a series of conflicting statements, Duterte has insulted U.S. President Barack Obama and the U.S. ambassador in Manila for questioning his war on drugs, which has led to the deaths of 2,300 people. He told Obama to "go to hell" and alluded to severing U.S. ties.

After weeks of anti-American rhetoric, Duterte said the Philippines would maintain its existing defence treaties and its military alliances.

China has expressed support for Duterte's drug war, even as it has sparked concerns in Western capitals about extrajudicial killings.

Philippine police made 29 arrests at the rally outside the U.S. embassy, where protesters were calling for the removal of U.S. troops in the southern island of Mindanao.