BANGKOK — As President Xi Jinping of China begins a state visit to Manila on Tuesday, he can count on few counterparts more eager than President Rodrigo Duterte of the Philippines.

“I simply love Xi Jinping,” Mr. Duterte said in April. “He understands my problem and is willing to help, so I would say, ‘Thank you, China.’”

On Monday, Mr. Xi returned the affection, describing how bilateral relations have rebounded since a low point in 2016 when the Philippines successfully challenged China’s territorial ambitions in the South China Sea before an international tribunal.

“Our relations have now seen a rainbow after the rain,” Mr. Xi wrote in an article disseminated by Xinhua, the Chinese state news agency.