WASHINGTON — President Trump on Saturday invited the president of the Philippines, Rodrigo Duterte, to the White House, embracing an authoritarian leader who is accused of ordering extrajudicial killings of drug suspects and who crudely disparaged Mr. Trump’s predecessor, Barack Obama.

Mr. Trump had a “very friendly conversation with Mr. Duterte,” according to a statement issued by the White House late Saturday. It said that the two leaders “discussed the fact that the Philippines is fighting very hard to rid its country of drugs.”

In fact, Mr. Duterte’s war on drugs has resulted in the deaths of several thousand people suspected of using or selling narcotics, as well as others who may have had no involvement with drugs. Human rights groups and many Western governments have condemned Mr. Duterte for the bloody campaign.

A spokesman for Mr. Duterte, Ernesto Abella, confirmed the White House invitation, saying that Mr. Trump had expressed “his understanding and appreciation of the challenges facing the Philippine president, especially on the matter” of drugs.

Mr. Trump’s embrace of the Philippine leader comes a week after Mr. Trump called to congratulate President Recep Tayyip Erdogan of Turkey for his victory in a disputed referendum that cemented his autocratic rule. He has also lavishly praised President Xi Jinping of China in recent days for his cooperation in pressuring North Korea, overlooking the fact that Mr. Xi, too, has shown an increasingly repressive streak in his country.

Mr. Trump has spoken warmly of the Egyptian leader, Abdel Fattah el-Sisi, who seized power in a military coup. And he vowed during the presidential campaign to reset relations with President Vladimir V. Putin of Russia.

An outspoken populist with a shoot-from-the-hip style, Mr. Duterte shares some characteristics with Mr. Trump. That was not the case with Mr. Obama, whom Mr. Duterte called a “son of a whore” when he was asked how he would react if Mr. Obama raised human rights issues with him. He later apologized, and his aides said his comment was an expression of frustration rather than a personal attack against the American president.