Rodrigo Duterte was sworn in Thursday as president of the Philippines, with many hoping his maverick style will energize the country but others fearing he could undercut one of Asia's liveliest democracies amid his threats to kill criminals en masse.

The 71-year-old former prosecutor and longtime mayor of southern Davao city won a resounding victory in May's elections in his first foray into national politics. He has described himself as the country's first leftist president and declared his foreign policy would not be dependent on the United States, a longtime treaty ally.

Duterte, who begins a six-year term as president, captured attention with promises to cleanse the poor Southeast Asian nation of criminals and government crooks within six months — an audacious pledge that was welcomed by many crime-weary Filipinos but alarmed human rights watchdogs and the dominant Roman Catholic Church.

Shortly after Duterte's election win, police launched an anti-drug crackdown under his name, leaving dozens of mostly poor drug-dealing suspects dead in gunfights or in mysterious circumstances.

Vice President Leni Robredo, a human rights lawyer who comes from a rival political party, was sworn in earlier in a separate ceremony. Vice presidents are separately elected in the Philippines, and in a sign of Duterte's go-it-alone style, he has not met her since the May 9 vote.

In a country long ruled by wealthy political clans, Duterte rose from middle-class roots. He built a reputation on the campaign trail with profanity-laced speeches, sex jokes and curses that sideswiped even the widely revered pope and the United Nations.

His brash style has been likened to that of presumptive U.S. Republican presidential nominee Donald Trump, although he detests the comparison and says the American billionaire is a bigot and he's not.

Duterte is the first president to come from the country's volatile south, homeland of minority Muslims and scene of a decades-long Muslim separatist insurgency, where he said his central Philippine-based family migrated in search of better opportunities.

His informal, down-to-earth demeanor and use of the local dialect and disclosures of his foibles has endeared him to the poor, which make up at least a quarter of the more than 100 million Filipinos.

After his resounding victory, he promised to mellow down on the vulgarity and promised Filipinos will witness a "metamorphosis" once he gets settled in the seat of power.

Days before his swearing in, however, Duterte was still threatening criminals with death if they wouldn't reform.

"If you destroy my country, I will kill you," he said in a warning to criminals in a speech during the last flag-raising ceremony he presided as mayor in Davao city this week.

Duterte's unorthodox style has also sparked questions on how he would handle foreign relations.

He has suggested he will keep the U.S. at arm's length and has shown readiness to mend frosty ties with China. Those potential shifts have raised the specter of another difficult phase in more than a century of a love-hate relationship between the Philippines and its former colonizer.

"I will be charting a course on its own and will not be dependent on the United States," he said last month.

A senior Philippine diplomat said American and Australian officials are curious how the new president will handle relations with their governments, which have enjoyed strong ties with outgoing President Benigno Aquino III, who bolstered security relations as a way to counter China's assertiveness in disputed South China Sea territories.

The Chinese ambassador, on the other hand, has worked hard to repair damaged relations with Manila. He told Filipino diplomats Beijing would extend an invitation to the new president to visit China within the next six months, according to the Philippine diplomat who spoke to The Associated Press on condition of anonymity for lack of authority to discuss such topic with reporters.

Duterte's new diplomatic tack provides an opportunity for China to rebuild relations with the Philippines, which under Aquino brought its territorial disputes with Beijing to international arbitration — something China vehemently opposed.

An arbitration tribunal in The Hague is scheduled to rule July 12 on the case, in which the Philippine government questioned the validity of China's vast territorial claims. China has refused to join the arbitration.

Duterte's initial policy pronouncements point to potential problems for Washington.

The longtime allies have worked together to counter China's territorial advances in the South China Sea, including holding joint military exercises.

The Philippines has one of the most underfunded militaries in Asia and its move to seek U.S. help has dovetailed with Washington's effort to reassert its presence in a region, where China has rapidly expanded its influence.

"Definitely if the Philippines backs away somewhat from supporting the U.S. in the South China Sea, this would be a problem for the U.S.," said Malcolm Cook, a senior fellow at the Institute of Southeast Asian Studies Yusof Ishak Institute in Singapore.

"China likes to present the U.S. as a destabilizing outsider in the South China Sea and in Asia more generally," he said. "The fewer Asian states that publicly counter this Chinese depiction, the more isolated the U.S."