Philippine President Rodrigo Duterte declared his "separation" from the US on Thursday, as he aims to realign his country with China.
The US is a longstanding ally of the Philippines, but Duterte was infuriated by US criticism of his bloody war on drugs. Duterte previously insulted US President Barack Obama while alluding to severing ties with the old colonial power.
"I announce my separation from the United States," he said to applause at a meeting in the Chinese capital.
His comments came after he met his Chinese counterpart Xi Jinping at the Great Hall of the People on Tiananmen Square. The two leaders pledged to enhance trust and friendship while playing down a maritime dispute.
Duterte is in China for a four-day visit which is seen as confirming his leaning away Washington and towards Beijing.
Three months ago, the Philippines won a landmark case in The Hague against China in the South China Sea where Beijing has built a series of artificial islands. However, Duterte on Wednesday said the case would “take a back seat” during talks, and that he would wait for the Chinese to bring up the issue rather than doing so himself.
China has welcomed the Philippines approach, even as Duterte has vowed not to surrender any sovereignty to Beijing, which views The Hague's South China Sea ruling as null and void.
Xi called the two countries "neighbours across the sea" with "no reason for hostility or confrontation", the official Xinhua news agency said.
“I hope we can follow the wishes of the people and use this visit as an opportunity to push China-Philippines relations back on a friendly footing and fully improve things,” Xi said.
The two leaders held "extensive" and "amicable" official talks and oversaw the signing of 13 bilateral cooperation documents. The deals include business, infrastructure, and agriculture, among other fields, Chinese foreign ministry spokeswoman Hua Chunying said, without giving details.
Duterte had earlier said that China was "good."
"It has never invaded a piece of my country all these generations," he added.
Row over South China Sea
Duterte has also suspended joint US-Philippine patrols in the strategically vital South China Sea. It has also threatened an end to joint military exercises.
The South China Sea is of intense interest to Washington. 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.