Donald Trump and Philippine President Rodrigo Duterte. File/Composite

KUALA LUMPUR - Philippine President Rodrigo Duterte congratulated Donald Trump on his election win and said on Wednesday he now wishes to stop quarreling with the United States, recalling his anger at the Obama administration for criticizing him.

The maverick leader, dubbed "Trump of the East" for his unrestrained rants and occasional lewd remarks, has repeatedly hit out at Washington in recent months, threatening to cut defense pacts and end military joint drills.

"I would like to congratulate Mr. Donald Trump. Long live," Duterte said in a speech to the Filipino community during a visit to Malaysia.

"We are both making curses. Even with trivial matters we curse. I was supposed to stop because Trump is there. I don't want to quarrel anymore, because Trump has won."

Duterte won a May election by a huge margin and is often compared with Trump, having himself been the alternative candidate from outside of national politics.

He campaigned on a populist, anti-establishment platform and struck a chord among ordinary Filipinos with his promises to fix what he called a broken country.

But the biggest surprise of Duterte's presidency so far has been his hostility toward the United States, shown during near-daily eruptions of anger over its concerns about human rights abuses during his deadly war on drugs.

He has also threatened repeatedly to severe a military relationship that has been a key element of Washington's "pivot" to Asia.

Duterte on Wednesday told Filipinos how angry he had been at Washington, saying it had threatened to cut off aid and had treated the Philippines like a dog tied to a post.

"They talk as if we are still the colonies," he said.

"You do not give us the aid, shit, to hell with you," he said, recalling comments he had directed at Obama.

Last month Trump told Reuters that the Philippines was a very important strategic location and that Duterte's comments about removing foreign troops showed "a lack of respect for our country."

Teddy Locsin Jr, Duterte's incoming ambassador to the United Nations, said there were a few parallels between Trump, who stunned the world by defeating rival Hillary Clinton in Tuesday's presidential election, and Duterte.

"I remember Trump in the middle of one of his statements, he said 'I will not talk like this after I become president'," Locsin said on TV. "I remember someone who also said the same thing." (Reporting by Rozanna Latif; additional reporting by David Brunnstrom in Washington; Writing by Martin Petty; Editing by Alex Richardson and Lisa Shumaker)