Hong Kong (CNN)Speaking in Beijing's Great Hall of the People during his first state visit to China in 2016, Philippines President Rodrigo Duterte heralded a bold new era in his country's foreign policy: "America has lost now," he said. "I've realigned myself in your ideological flow."
Why the Philippines election could be a win for China
While Duterte later clarified that he was not planning to sever ties with the United States -- a treaty ally and longstanding diplomatic partner -- he continued to threaten to downgrade the relationship while pivoting to China, despite a simmering territorial dispute with Beijing.
Now, with the election to decide Duterte's successor underway, analysts say there is an opportunity for a reset of the Philippines' relationships with both major powers -- and its outcome could shift the balance of power in Asia.
How that shapes up may come down to the aims of current presidential frontrunner Ferdinand Marcos Jr. -- the son and namesake of the Philippines' late deposed dictator -- who is widely seen as more friendly to China than his nearest rival Leni Robredo, the sitting vice president.
Who Filipinos pick when they cast their votes on Monday, will have ramifications far beyond the country's borders.
For the US, close ties with the Philippines, including American troop rotations there under a two-decade-old agreement, are critical to its strategy in the region, where Washington seeks to counter Beijing's growing footprint.
The Philippines has been on the front line of those Chinese ambitions in the South China Sea, with Manila in recent years accusing Beijing of trying to intimidate its coast guard vessels and assembling a "maritime militia" to crowd out its fishing boats. Beijing claims large swaths of the resource-rich waters as its own, even after Manila challenged that in an international court of arbitration and won.
But Duterte did little to assert that 2016 court decision, analysts say, and how much the next Philippine President uses the ruling to push back on an expansive China will send signals not only to the leaders of other Southeast Asia nations who dispute China's territorial claims -- but also to Beijing.
"The Philippines is of very significant strategic importance to both (the US and China). China is right now consumed by domestic matters but it also continues to expand its activities in the South China Sea," said Joshua Kurlantzick, a senior fellow for Southeast Asia at the Council on Foreign Relations in New York.
"And the US is definitely going to invest significant effort bonding with whoever leads the Philippines, simply for strategic reasons -- the Philippines is of critical strategic importance, and there are also such close longstanding ties," he said.
Manila has long sought to balance its ties with these powers -- or play them off one another -- and any President coming to power will need to navigate relationships with both, especially in the wake of Duterte's pro-China bent.
Marcos, whose running mate is Duterte's daughter, Sara, has for years called for Manila to deal with Beijing bilaterally over territorial claims.
Critics see his stance as deferential to China, and in recent months Marcos has met the Chinese Ambassador Huang Xilian.
Beijing has praised its relationship with Duterte ever since his first visit to China -- described by Chinese leader Xi Jinping last month as "an ice-breaking trip marking a milestone in the history of China-Philippines relations", with Xi also saying China "stands ready" to "constantly elevate" relations.
The goodwill appears to extend to Marcos, who has been building a rapport with Chinese Ambassador Huang Xilian in recent months. Huang said during an event in October that it was a "great honor" to meet Marcos and that as those in support of Sino-Philippines ties, "together, we are opening a brighter future."
When it comes to the US, one issue is a human rights suit in the US seeking compensation for the victims of the late, elder Marcos' brutal regime.