Philippines' President Rodrigo Duterte made the comment about ending military and economic ties with the US at a business forum in the presence of Chinese Vice Premier Zhang Gaoli at Beijing's Great Hall of the People.
Earlier, Duterte and his Chinese counterpart Xi Jinping pledged to enhance trust and deepen cooperation, as Manila's new leader seeks to rebalance his country's diplomacy away from the US.
China welcomed Duterte - who donned a suit and tie for the occasion - with an official ceremony outside the Great Hall of the People on Tiananmen Square, with the two leaders striding side-by-side down the red carpet inspecting an honour guard, with children cheering.
Xi called the two countries "neighbours across the sea", the official Xinhua news agency said.
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.
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.
The two leaders held "extensive" and "amicable" official talks and oversaw the signing of 13 bilateral cooperation documents on business, infrastructure, and agriculture, among other fields, Chinese foreign ministry spokeswoman Hua Chunying said, without giving details.
In a statement, the 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.
Duterte's 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.
"Your stay in my country was for your own benefit. So time to say goodbye, my friend," he said, as if addressing the US.
He also repeated his denunciation of Obama as a "son of a whore".
'Candid and friendly'
China, he said earlier, was "good". "It has never invaded a piece of my country all these generations."
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 Hua 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.