“The president is embracing the most reckless and despotic ruler in Saudi history,” said Bruce Riedel, a former C.I.A. official now at the Brookings Institution and author of “Kings and Presidents,” about ties between Saudi and American leaders. “He has made the relationship with the Saudis a partisan political issue. If a Democrat wins in 2020, we are likely to face an existential crisis in the relationship over Khashoggi and Yemen.”

Human rights and journalism advocacy groups said Mr. Trump’s breakfast with Prince Mohammed would embolden autocrats around the world, making clear to them that they could repress and even assassinate journalists with impunity without being held accountable by the United States.

“Instead, President Trump’s efforts to excuse Khashoggi’s murder and discourage any investigation have made him an accessory after the fact to one of the most heinous crimes in recent history,” said Joel Simon, executive director of the Committee to Protect Journalists.

But Mr. Trump has made clear that in his estimation, the relationship is more important than any single incident, telling NBC News last week that he did not want to jeopardize profitable arms sales to Saudi Arabia by speaking out on Mr. Khashoggi’s death.

Some foreign policy specialists said that was just the distasteful reality of international relations. American presidents, they said, have little choice but to interact with sometimes loathsome figures in the pursuit of larger goals vital to the national security of the United States. Saudi Arabia, they said, has been the linchpin of American influence in the Middle East and energy security for decades.

“It’s absolutely vital that the president confer closely with the de facto leader of Saudi Arabia — and be seen to be conferring openly and confidently,” said Michael Doran, a senior fellow at the Hudson Institute. “Saudi Arabia is the most important Arab ally of the United States, an indispensable partner in the effort to contain and denuclearize Iran, and the most influential single actor in the Muslim world.”

It was not as if Prince Mohammed could look around the conference in Osaka and see only uncompromised figures. President Vladimir V. Putin has presided over a crackdown in Russia and has been blamed for the deaths of some journalists and political opponents. President Xi Jinping of China rules the largest state of repression in the world, one that has detained hundreds of thousands of ethnic Uighur Muslims, if not more, for high-pressure indoctrination.