BEIJING — President Rodrigo Duterte of the Philippines and China’s leader, Xi Jinping, agreed on Thursday to resume direct talks on disputes in the South China Sea after years of escalating tension, a sign of warming relations with Beijing.
The announcement came during Mr. Duterte’s state visit to China, as he repeatedly sought to distance the Philippines from the United States, a treaty ally. Mr. Duterte, speaking to business leaders shortly after meeting with Mr. Xi, openly declared a “separation from the United States.”
He refrained, however, from saying that he would revoke a 70-year-old treaty alliance with Washington and made no indication of doing what China would like most: scrapping an accord that gives the United States access to five military bases in the Philippines.
The decision to reopen discussions on the South China Sea after a hiatus of several years offers the promise of de-escalating tensions in the South China Sea, an issue that has strained Washington’s relationship with Beijing.
“Though we come to your country close to winter, it is the springtime of our relationship,” Mr. Duterte told Mr. Xi in their talks afterward, according to reporters who were allowed to observe part of their meeting.
But Mr. Duterte has alarmed United States officials by asserting that the Philippines would reduce its military cooperation with Washington, and his openly anti-American sentiments this week, as well as his tilt toward Beijing, may add to their concerns. How far Mr. Duterte, whose military is underequipped and poorly trained, will venture in actually splitting from the United States is still unclear.
The president, in his remarks to the business forum on Thursday, suggested that the separation would extend to the “military, not maybe social, but economics also. America has lost.”
He continued, “I’ve realigned myself in your ideological flow, and maybe I will also go to Russia to talk to Putin.”
A day earlier, Mr. Duterte struck a similarly resistant tone before a group of Philippine citizens living in China. “Time to say goodbye, my friend,” he said of the United States.
“I will not go to America anymore,” he added. “I will just be insulted there.”
Revoking the alliance with the United States would alienate Philippine citizens — and the military — which has strongly favored Washington.
Although Mr. Duterte, who took office in June, is popular at home, the people there hold more positive attitudes toward the United States, the former colonial power, than the president does.
A poll by the Pew Research Center in 2015, about global attitudes toward the United States, showed that 92 percent of Philippine residents held a favorable view of the United States, the country with the highest showing in Asia.
It is unclear when talks on the South China Sea would start or what their focus would be.
However, Mr. Duterte signaled Wednesday night that one obstacle to such discussions — a July ruling on the disputes by an international tribunal in The Hague, which was overwhelmingly in the Philippines’ favor — could be overcome. China has refused to abide by the court’s ruling, and Mr. Duterte said Wednesday that the tribunal’s decision would “take a back seat.”
Under Mr. Duterte’s predecessor, Benigno S. Aquino III, the Philippines cut off bilateral discussions of their conflicting South China Sea claims in 2012, after China seized the disputed Scarborough Shoal and drove Philippine fishermen from it.
On Thursday, the two sides agreed to establish a joint coast guard committee on maritime cooperation, a potentially significant step because Chinese Coast Guard vessels have been keeping Philippine fishing boats from Scarborough Shoal.
In a gesture to Philippine fishermen, China’s vice foreign minister, Liu Zhenmin, said China would provide assistance with aquaculture and the commercial processing of fish, an issue that Mr. Duterte has emphasized. Mr. Liu said that the countries’ relationship was back to “full recovery” and that they would hold talks on broader defense and security issues, which had also been halted under Mr. Aquino.
“Both sides agreed that the South China Sea issue is not the sum total of the bilateral relationship,” Mr. Liu said.
On the investment front, China agreed to finance infrastructure in the Philippines, lifted the embargo on the import of tropical fruits, including mangoes, and said it would start encouraging its tourists to visit after removing a travel advisory on the Philippines.
But Mr. Duterte told reporters that he would not raise joint exploration with China for oil and gas in the South China Sea, a venture that Beijing would like.
He would have to consult with Parliament before broaching the possibility, he said.
Mr. Duterte is expected to address Chinese business leaders on Friday and may visit a drug rehabilitation center in Beijing to demonstrate his support for China’s tough policy on drug offenders. Unlike officials in the United States and other Western countries, China has refrained from criticizing Mr. Duterte’s deadly campaign against drugs, in which about 1,400 people have been killed by the police and hundreds more by vigilantes.
The Chinese have gone out of their way to offer Mr. Duterte wide access to top leadership. Later Thursday, Mr. Duterte was set to meet with Prime Minister Li Keqiang and two other members of the Chinese Communist Party’s all-powerful Standing Committee. By the time he leaves China, Mr. Duterte will have met with four of the committee’s seven members, including Mr. Xi — an unusual honor for a visiting leader.