Until recently, China was the Philippines biggest security threat. Relations hit rock bottom, following an international tribunal ruling in July in Manila's favor, rejecting Beijing's claim to almost all of the disputed waters.
But now, just months after pledging on the campaign trail to sail a jet ski into the South China Sea to defend Manila's territorial sea claims, (something Duterte now tells Al Jazeera was just election hyperbole) the Philippines leader has threatened to cut relations with the United States.
He has also suggested that he might start courting China and Russia instead.
No small task
But getting Beijing and Manila on track after years of tensions is no small task, analysts say.
Duterte is traveling to China with a group of more than 200 businessmen and boosting economic ties between the two countries is a key priority of the visit, says Aileen Baviera, a professor at the University of the Philippines' Asian Center.
"As far as the new Philippine government is concerned there is strong interest in placing emphasis on economic relations to get more trade, investment and participate in China's infrastructure development programs," Baviera says, adding that is something the two have not done in a long while.
Japan is the Philippines biggest trade partner, but Hong Kong is not far behind Tokyo in the lineup. Manila is looking for China's help to build up its railway system and guarantees for its workers overseas.
Fishermen in the Philippines who have been kept from trolling parts of the South China Sea because of territorial disputes hope the visit will help them regain access to fish, while the two sides talk.
Baviera says that while it is unlikely they'll be able to reset that issue during the visit, talking could help pave the way to new approaches and new initiatives.
President Duterte says he will not give any ground when it comes to the Philippines' sovereignty in the South China Sea, but also notes he will not be inflexible.
"We will stick to our claim, we do not bargain anything there. We continue to insist that that's ours and that the tribunal, the international decision will be taken up," he says. "But there will be no hard impositions. We will talk and maybe paraphrase everything in the judgment and set the limits of our territories."
China as savior
While the two countries still remain divided over that issue, they are finding other areas of common ground.
Duterte has lashed out at the United States and the European Union over their criticism of his controversial war on drugs. Beijing has offered to help in the effort and has invested in the construction of a drug rehab center.
China's Foreign Ministry says that during Duterte's visit this week, he will participate in anti-narcotics activities and both countries' anti-narcotics departments have begun to explore cooperation.
From the economy to the war on drugs Beijing is portraying itself as the Philippines' savior. Duterte has not been shy about how much he apparently needs China as well.
The headline for an interview between Duterte and China's state-run Xinhua News agency quotes him as saying, "Only China can help us." In the interview, he says that in addition to loans and Beijing's help in building up its railways and economic cooperation is more important that talking about disputes.
"War is not an option," he was quoted as saying.
Beijing too is expecting some deliverables.
An opinion piece published Monday in the party-backed Global Times was cautiously optimistic about the visit, noting that differences were too great to be resolved in just one visit.
"The significance of Duterte's visit will depend on whether any specific deals will be inked in the days to come," the article says. "As long as there are agreements between the two sides, big or small, they might bring about a turning point in Sino-Philippine relations."
Comment: It's not that China is portraying itself as the Philippines' savior; China is a more natural partner for them and isn't trying to dominate the country. The dispute over the South China Sea is a valid one for China as they have a historic claim and use of the waters. Still, both sides are keen on resolving the issue, much to the chagrin of a certain Western hegemon. Here's some relevent quotes from Duterte's interview with Xinhua:
'Only China can help Philippines': Duterte turns to Beijing as rift with US widens
"My grandfather is Chinese. It's only China that can help us," Duterte, who was elected in June, told Chinese state news agency Xinhua before embarking on a four-day trip that begins Tuesday.
"All that I would need to do is just to talk and get a firm handshake from the officials and say that we are Filipinos and we are ready to cooperate with you, to help us in building our economy and building our country."
"If we can have the things you have given to other countries by the way of assistance, we'd also like to be a part of it and to be a part of the greater plans of China about the whole of Asia, particularly Southeast Asia," said the 71-year-old leader.
"There is no sense in going to war. There is no sense fighting over a body of water," said Duterte of the lucrative shipping route, which could also become a major source of hydrocarbons. "It is better to talk than war. We want to talk about friendship, we want to talk about cooperation, and most of all, we want to talk about business. War would lead us to nowhere."
"We are not interested in allowing another country to talk. I just want to talk to China," said Duterte.
"Some other countries know we are short of money, but instead of helping us, all they had to do was just to criticize. China never criticizes. They help us quietly. And I said that's why it's part of the sincerity of the people," Duterte told Xinhua.