WASHINGTON — When President Trump called President Rodrigo Duterte of the Philippines on Saturday, the American leader’s national security aides saw it as part of a routine diplomatic outreach to Southeast Asian leaders. Mr. Trump, characteristically, had his own ideas.

During their “very friendly conversation,” the administration said in a late-night statement, Mr. Trump invited Mr. Duterte, an authoritarian leader accused of ordering extrajudicial killings of drug suspects in the Philippines, to visit him at the White House.

Now, administration officials are bracing for an avalanche of criticism from human rights groups. Two senior officials said they expected the State Department and the National Security Council, both of which were caught off guard by the invitation, to raise objections internally.

The Run-Up

The podcast that makes sense of the most delirious stretch of the 2016 campaign.

The White House disclosed the news on a day when Mr. Trump fired up his supporters at a campaign-style rally in Harrisburg, Pa. The timing of the announcement — after a speech that was an angry, grievance-filled jeremiad — encapsulated this president after 100 days in office: still ready to say and do things that leave people, even on his staff, slack-jawed.

“By essentially endorsing Duterte’s murderous war on drugs, Trump is now morally complicit in future killings,” said John Sifton, the Asia director of Human Rights Watch. “Although the traits of his personality likely make it impossible, Trump should be ashamed of himself.”

Administration officials said the call to Mr. Duterte was one of several to Southeast Asian leaders that the White House arranged after picking up signs that they felt neglected because of Mr. Trump’s intense focus on China, Japan and tensions over North Korea. On Sunday, Mr. Trump spoke to the prime ministers of Singapore and Thailand; both got White House invitations.

Mr. Duterte’s toxic reputation had already given pause to some in the White House. The Philippines is to host a summit meeting of the Association of Southeast Asian Nations in November, and officials said there was a brief debate about whether Mr. Trump should attend.

It is not even clear, given the accusations of human rights abuses against him, that Mr. Duterte would be granted a visa to the United States were he not a head of state, according to human rights advocates.

Still, Mr. Trump’s affinity for Mr. Duterte — and other strongmen as well — is firmly established. Both presidents are populist insurgent leaders, with a penchant for making inflammatory statements. Both ran for office calling for a wholesale crackdown on Islamist militancy and the drug trade. And both display impatience with the courts.

After Mr. Trump was elected, Mr. Duterte called to congratulate him. Later, the Philippine leader issued a statement saying that the president-elect had wished him well in his antidrug campaign, which 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.

Mr. Trump’s cultivation of Mr. Duterte has a strategic rationale, officials said. Mr. Duterte had pivoted away from the United States, a longtime treaty ally, and toward China. The alienation deepened after he referred to President Barack Obama as a “son of a whore” when he was asked how he would react if Mr. Obama raised human rights concerns with him.

In October, Mr. Duterte called for a “separation” between the Philippines and the United States. “America has lost now,” he told an audience of business executives in Beijing. “I’ve realigned myself in your ideological flow.” He later threatened to rip up an agreement that allows American troops to visit the Philippines.

Interactive Feature | ‘They Are Slaughtering Us Like Animals’ Inside President Rodrigo Duterte’s brutal antidrug campaign in the Philippines, our photojournalist documented 57 homicide victims over 35 days.

Administration officials said Mr. Trump wanted to mend the alliance with the Philippines as a bulwark against China’s expansionism in the South China Sea. The Philippines has clashed with China over disputed reefs and shoals in the waterway, which the two countries share.

Mr. Trump’s chief of staff, Reince Priebus, drew a connection between a visit by Mr. Duterte and the North Korea crisis. Building solidarity throughout Asia, he said on ABC’s “This Week,” is important to pressuring North Korea on its nuclear and ballistic missile programs.

Experts said that argument was tenuous, however, noting that it was more important to corral a country like Malaysia, where North Koreans hold meetings to buy or sell weapons-related technology.

Mr. Trump has a commercial connection to the Philippines: His name is stamped on a $150 million, 57-floor tower in Manila, a licensing deal that netted his company millions of dollars. Mr. Duterte appointed the chairman of the company developing the tower, Jose E. B. Antonio, as an envoy to Washington for trade, investment and economic affairs.

Certainly, the two leaders have a similar agenda. Mr. Duterte is battling Islamist extremists who have terrorized the southern islands of the Philippine archipelago. He once declared that if he were presented with a suspected terrorist, “give me salt and vinegar and I’ll eat his liver.”

They are also in tune on the need for a crackdown on drugs, even if Mr. Trump is not advocating Mr. Duterte’s brutal methods. Attorney General Jeff Sessions has revived the language of the “war on drugs” that the Obama administration shunned as part of its policy to reduce lengthy prison sentences for nonviolent drug offenders.

Mr. Trump has drawn the line with one autocrat: President Bashar al-Assad of Syria, whose chemical weapons strike on his own people prompted the president to order a Tomahawk missile strike on a Syrian airfield.

But his affinity for strongmen is instinctive and longstanding. Mr. Trump called to congratulate President Recep Tayyip Erdogan of Turkey for his victory in a much-disputed referendum expanding his powers, which some critics painted as a death knell for Turkish democracy.

At his rally in Harrisburg, Mr. Trump went after many of the same targets he vilified during the campaign: the news media, Democrats, immigrants. But he reversed course on one — China — and the difference may be that he met recently with China’s president, Xi Jinping, in Palm Beach, Fla.

At home, Mr. Xi is cracking down on dissent and consolidating his power. But Mr. Trump has enlisted Mr. Xi to pressure his neighbor, North Korea, and he is giving him the benefit of the doubt. “I honestly believe he’s trying very hard,” Mr. Trump told the crowd. “He’s a good man.”

Mr. Trump credited his relationship with Egypt’s president, Abdel Fattah el-Sisi, as a factor in obtaining the release of an Egyptian-American aid worker, Aya Hijazi, who had been detained there. Mr. Trump played host at the White House to Mr. Sisi, who had not been granted an invitation since he seized power in a military coup nearly four years ago.

Then there is, of course, Mr. Trump’s vow during the campaign to pursue a warmer relationship with President Vladimir V. Putin of Russia. That effort has faltered somewhat because of persistent questions about links between the Trump campaign and Russian officials.

Even Mr. Trump’s prime antagonist — the North Korean dictator, Kim Jong-un — has earned a surprisingly generous assessment from the president. Speaking on “Face the Nation,” Mr. Trump expressed admiration that Mr. Kim had been able to keep a grip on power.

“A lot of people, I’m sure, tried to take that power away, whether it was his uncle or anybody else,” Mr. Trump said. “And he was able to do it. So, obviously, he’s a pretty smart cookie.”