Philippine President Rodrigo Duterte makes a "fist bump", his May presidential elections campaign gesture, with soldiers during a visit at Capinpin military camp in Tanay Thomson Reuters By Enrico Dela Cruz and Manuel Mogato

MANILA (Reuters) - The Philippines moved to shore up relations with the United States on Tuesday with guarantees that a treaty between them would be honored and security ties were "rock solid", despite President Rodrigo Duterte's railings against Washington.

The firebrand leader launched more verbal salvos on Monday about what he called atrocities under American colonial rule of the archipelago nation, saying U.S. special forces working in the restive south under a defense treaty should leave because they were complicating counter-insurgency operations.

Duterte is hugely popular at home for his brash comments and take-charge style, but the frequency of his tirades against Washington, including calling President Barack Obama a "son of a bitch" last week, has tested a relationship of strategic importance to both sides.

Foreign Minister Perfecto Yasay said Duterte's remarks, including that the southern Philippines "would never have peace" while allied with Washington, should not be taken as a signal that a pact between them would be abrogated.

"The president has said, even as a priority statement in his inaugural address, that we will respect and continue to honor our treaty obligations and commitments," Yasay said in a radio interview.

Duterte said during an oath-taking ceremony for state officials on Monday that U.S. special forces in Zamboanga "must go", because they could become high-value targets for the Islamist Abu Sayyaf rebels, who are notorious for kidnapping and beheading foreigners.

The military said only a "token" number of American troops would be impacted by the withdrawal and broader military programs were intact.

"We assure our people and allies that Philippine-U.S. defense relations remain rock solid," armed forces spokesman Brigadier-General Restituto Padilla said in a statement.

NOT BACKING OUT

Duterte on Monday also showed those at the ceremony pictures of what he said were victims of colonial-era atrocities against Muslims in Mindanao, repeating assertions that Americans were to blame for the instability that has dogged the region.

Presidential spokesman Ernesto Abella described Duterte's presentation as a "backgrounder" for Filipinos about the strife in Mindanao and to explain his independent foreign policy.

"These actions, these references that he's making, are intended to communicate to one and all that we need to be ready to chart our own course," Abella told reporters.

"We're not turning our back on anybody."

White House spokesman Josh Earnest on Monday emphasized shared concerns and interests with the Philippines, then took a thinly veiled swipe at Duterte. Earnest appeared to compare Duterte - who won a May election by a huge margin - to Donald Trump, the outspoken Republican candidate in the Nov. 8 presidential election.

"Elections do say a lot about what kind of person is going to represent your country on the international stage..." he told a regular news briefing.

"That's certainly something that the Filipino people are well aware of."

The United States at its peak had 1,200 special forces providing technical and logistics support in Mindanao as part of a program that was discontinued in 2015.

Only a few remain and Washington's security priority has since shifted toward the South China Sea, where it has staunchly supported Manila's calls for Beijing to allow freedom of passage and avoid confrontation.

Ranhilio Aquino, a Catholic priest and dean of the San Beda Graduate School of Law, said Duterte and his advisers should study the treaties carefully and consider whether it was the right time to strain important alliances.

"When you are being bullied, and you want international rule to prevail, you need help from your friends," he said.

"And while it is true that the Americans have profited a lot from us, let us not deny the fact that we have also profited from them."

(Writing by Martin Petty; Editing by Nick Macfie)