© AP
In this Sept. 7, 2016, photo, Chinese Premier Li Keqiang (L) and Philippine President Rodrigo Duterte link arms during an ASEAN summit in Vientiane, Laos. After lashing out at longtime ally America, Duterte is making a state visit to China in an apparent charm offensive.
A visit by the Philippine's recently elected, and feisty, President Rodrigo Duterte to China this week is being watched closely for signs of a shift in ties between the two countries, which have been battered for years over territorial disputes in the South China Sea.

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."