"There are so many factors involved. But I'd rather be friendly to them now," Duterte told residents of the central town of Balangiga during a visit, according to an official transcript released today.
Islamic militants waving the black IS flag occupied the southern city of Marawi on May 23, and have fought off a US- backed military assault for more than four months.
The US deployed a P-3 Orion spy plane and provided other intelligence inputs to Philippine forces trying to retake the city in fighting which has left more than 900 people dead.
"So without their help also, we would be having a hard time," he said. "So we thank you."
More From This Section
Duterte marked the start of his six-year term last year with foul-mouthed rants against the US as he steered his country away from the decades-old alliance while chasing trade and investment from Washington's rival Beijing.
During a visit to China last October Duterte announced his "separation from the United States," stating he was realigning with China and Russia instead.
He had also denounced the US government over its bloody colonisation of the Philippines in the 1900s.
"But these are all water under the bridge," Duterte said, citing the US alliance against Japan's occupation army during World War II.
Manila won independence in 1945 after the war, with the two countries also signing a mutual defence treaty in 1951.