Beijing (AFP) - Philippines' President Rodrigo Duterte declared his "separation" from longstanding ally the United States in Beijing on Thursday, as he rebalances his country's diplomacy towards China.

Duterte is in China for a four-day trip seen as confirming his tilt away from Washington and towards Beijing's sphere of influence -- and its deep pockets.

"I announce my separation from the United States," he said to applause at a meeting in the Chinese capital.

"America does not control our lives. Enough bullshit," he added in a rambling speech that flipped between languages.

"How can you be the most powerful industrial country when you owe China and you are not paying it?"

His comments came after he met his Chinese counterpart Xi Jinping at the Great Hall of the People on Tiananmen Square, with the two men pledging to enhance trust and friendship, while playing down a maritime dispute.

Xi called the two countries "neighbours across the sea" with "no reason for hostility or confrontation", the official Xinhua news agency said.

Under Duterte's predecessor Benigno Aquino the two countries were at loggerheads over the South China Sea -- where Beijing has built a series of artificial islands -- but since taking office in June the new head of state has changed course.

In a statement, the Chinese foreign ministry cited Xi as telling Duterte their emotional foundation of friendly good neighbourliness was unchanged, and difficult topics of discussion "could be shelved temporarily".

Duterte called the meeting "historic", it added.

His visit to Beijing capped a series of recent declarations blasting the US and President Barack Obama.

Addressing the Filipino community in Beijing Wednesday, the firebrand leader said the Philippines had gained little from its long alliance with the US, its former colonial ruler.

He also repeated his denunciation of Obama as a "son of a whore".

China, he said earlier, was "good". "It has never invaded a piece of my country all these generations."

Story continues

- 'Candid and friendly' -

Duterte has also suspended joint US-Philippine patrols in the strategically vital South China Sea, and has threatened an end to joint military exercises.

The South China Sea is of intense interest to Washington and it has repeatedly spoken out on the various territorial disputes between China and its neighbours over the waters.

Tensions have risen between the US and China over Washington's so-called "pivot" to the Asia-Pacific, a move that Beijing says is intended to contain it.

In 2012, China seized control of Scarborough Shoal, a fishing ground in the Philippines' exclusive economic zone.

In a case brought by Aquino, the Philippines won a resounding victory at an international tribunal earlier this year over Beijing's extensive territorial maritime claims in the area, infuriating the Asian giant.

But Duterte, who took office in June shortly before the tribunal ruling, has made a point of not flaunting the outcome.

Asked whether the leaders had discussed the South China Sea, the foreign ministry's spokesperson Hua Chunying said they had a "candid and friendly exchange of views on how to resolve relevant disputes".

Their meeting represented a "return to the right track of dialogue and consultation" she said, adding China was willing to make "relevant arrangements" to cooperate on fishery issues.

- 'Full recovery' -

The meeting between Xi and Duterte marked a "full recovery" of the "traditional friendship" between the two countries, Chinese vice minister Liu Zhenmin said, according to a transcript released by the Philippine president's office.

They oversaw the signing of 13 bilateral cooperation documents on business, infrastructure, and agriculture, among other fields, he added.

Beijing also has offered the Philippines a $9 billion soft loan for development projects, a statement from the Philippine presidential press office said.

About $15 million of the promised loans will be earmarked for drug rehabilitation programmes amid Duterte's anti-drug campaign, which has killed thousands of people and raised concern abroad of human rights violations.

China will also lift bans on 27 Philippine tropical fruit export companies. Previous sanctions on fruit were intended to punish Manila for its South China Sea stance.