WASHINGTON — Ever since he seized power in a military takeover nearly four years ago, President Abdel Fattah el-Sisi of Egypt has been barred from the White House. But President Trump made clear on Monday that the period of ostracism was over as he hosted Mr. Sisi and pledged unstinting support for the autocratic ruler.

“We agree on so many things,” Mr. Trump said as he sat beside Mr. Sisi in the Oval Office. “I just want to let everybody know in case there was any doubt that we are very much behind President el-Sisi. He’s done a fantastic job in a very difficult situation. We are very much behind Egypt and the people of Egypt. The United States has, believe me, backing, and we have strong backing.”

In that one moment, Mr. Trump underscored a fundamental shift in American foreign policy since he took office. While his predecessors considered authoritarians like Mr. Sisi to be distasteful and at times shied away from them, Mr. Trump signaled that he sees international relations through a transactional lens. If Egypt can be a partner in the battle against international terrorism, then in Mr. Trump’s calculation, that is more important to the United States than concerns over its brutal suppression of domestic dissent.

Nothing could have made Mr. Sisi happier. He arrived from Cairo with a list of financial, security and political requests, but effectively he got what he really wanted in the six minutes that news media photographers were permitted in the Oval Office to record the visit that President Barack Obama had denied him. The picture of the general-turned-president in the White House, hosted by an American leader lavishing praise on him, was the seal of approval he had long craved, the validation of a strongman on the world’s most prominent stage.