First came the flattery, now the priceless gift. Since arriving in Beijing for his first official visit late Tuesday, Philippine President Rodrigo Duterte has showered his hosts with praise, stressing the deep historical links between their two nations, while brazenly soliciting financial assistance.

On Thursday, the bombastic 71-year-old made good on his toadying — agreeing that bilateral talks rather than legal wrangling would solve festering disputes in the South China Sea, where these neighbors tussle over islets claimed by both. “China has been a friend of the Philippines and the roots of our bonds are very deep and not easily severed,” Duterte told Chinese President Xi Jinping to open their meeting.

It marks a stunning about-face for the Philippines, which, under former President Benigno Aquino, was resolute in the face of Beijing’s sweeping territorial claims in the vital trade corridor, even winning an emphatic victory on the dispute at the Permanent Court of Arbitration at the Hague. To effectively ignore that ruling also impedes wider calls for a regional code of conduct over maritime disputes — a prospect championed by the U.S, as well as Singapore and a variety of other Southeast Asian nations.

It also seemed to have come as a surprise to some within his own government. Speaking to TIME by phone from Manila, Foreign Affairs spokesman Charles Jose said he had no direct knowledge that any agreement over the South China Sea was on the cards. “There was no discussion on the part of our Foreign Ministry [before the trip],” he said.

This shift will be a concern for Washington, which recently ramped up naval freedom of navigation exercises in the 3 million sq km waterway, through which over 5 trillion of cargo passes annually, and where China has been militarizing rocks and reefs. Thursday’s decision also crystalizes the cooling of relations between Manila and historic ally the U.S., which has criticized Duterte’s human-rights record owing to a bloody war on drugs that has seen more than 3,800 suspected pushers and addicts killed by police and vigilantes. In response, Duterte has vowed to expel U.S. Special Forces from his country’s restive south and roll back security cooperation with the U.S. military, which Aquino allowed to more frequently visit Philippine military bases. “We are not the vassal of everybody, we have long been independent,” Duterte told Chinese state broadcaster CCTV earlier in his trip.

The resumption of bilateral talks — plus the signing of 13 documents on shared cooperation on trade, defense and more — marks a rare foreign policy victory for Xi before next year’s pivotal 19th National Congress of the Chinese Communist Party (CCP), a sensitive time of transition when more than half of the Politburo Standing Committee, the nation’s top executive body, are expected to be replaced. “I definitely see the CCP clapping with glee with Duterte’s ‘bilateral’ talk,” says Joseph Franco, a Philippines expert at Singapore’s Nanyang University. “It is classic discursive infiltration — you get the enemy camp to use your phrases and buzzwords. You have got to admire the Chinese for that.”

Still, Beijing will be wary of Duterte’s notoriously mercurial nature. Even regarding his China visit, the former Davao mayor has gone from saying that the South China Sea would not be discussed, to that it would be brought up “in passing,” to Thursday’s landmark agreement. “Saying one thing and doing another is his style, but he just took power for several months, we need to watch what he will do next,” says Zhang Lili, director of the International Studies Department at the China Foreign Affairs University. “We can’t judge him just by what he has done.”

For Duterte, the move is certainly risky. He will face strong resistance within his own government and military, where senior figures have consistently contradicted their President’s fitful threats about severing ties with the U.S. But it is the Filipino people who may be even harder to assuage. The Philippines remains the world’s most pro-American nation and staunchly anti-Chinese, blaming the Asian superpower for aggressively targeting Philippine fishing stocks. Unless Duterte can show distinct benefits for the softening of his stance over the South China Sea, he may well see popular support drain, just like former President Gloria Arroyo, who similarly attempted to build bridges with Beijing.

“If in one year Duterte doesn’t get anything from the Chinese, then expect domestic pressure to increase,” says Richard Javad Heydarian, assistant professor of political science at Manila’s De La Salle University. “Probably by that time he won’t be that popular any more, and so he has to rally around the flag. So this flirtation with China may not be sustainable in the long run.”

—With reporting by Yang Siqi / Beijing

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Charlie Campbell at charlie.campbell@time.com.