Egyptian President Abdel Fatah al-Sissi speaks next to President Trump in the Oval Office on Tuesday. (Oliver Contreras/For The Washington Post)

Welcoming Egyptian President Abdel Fatah al-Sissi at the White House on Tuesday, President Trump delivered a diatribe against what he called “bad laws” and a legal system that “never, ever rules for us,” venting over a recent appeals court decision that scuttled his attempt to stem the flow of migrants into the country.

While Trump’s complaints about federal courts and the constitutional checks on presidential power are not new, they appeared discordant as he sat next to Sissi, a former military chief who has presided over an authoritarian consolidation of power and attacks on the judiciary.

Since taking power following a 2013 military coup, Sissi has jailed opponents and allegedly approved their torture, muzzled the press and silenced critics as he expanded the power of the security forces. A 2017 Human Rights Watch report estimated there are as many as 60,000 political prisoners in Egypt.

Sissi’s second White House visit was aimed at strengthening military and counterterrorism ties and securing at least tacit U.S. backing for his planned remake of the Egyptian constitution. A compliant parliament already has approved a rewrite that would allow Sissi to remain in power until 2034, and a national referendum is expected within weeks.

Trump, asked about what human rights groups call a blatant power grab in Egypt, said he was unaware of it.

“I think he’s doing a great job,” Trump said amid the din of reporters shouting questions in the Oval Office. “I don’t know about the effort. I can just tell you he’s doing a great job. Great president.”

Trump’s embrace of Sissi and public deflections over concerns raised about how the Egyptian is leading his country underscore the extent to which the administration is closely aligning itself with strongman leaders it believes can further U.S. interests regardless of considerations about human rights abuses or authoritarian tendencies.

Sissi praised Trump and said “relations have not been better” between Egypt and Washington, but he remained silent as Trump complained about legal and congressional checks on his border and immigration policies.

“We are building a lot of wall, and we are being very strong on the border,” Trump said. “But we are bucking a court system that never, ever rules for us, and we are bucking really bad things with the Democrats in Congress not willing to act.”

Trump singled out the U.S. Court of Appeals for the 9th Circuit, which he had tweeted Monday is “OUT OF CONTROL” following a lower-court ruling against his policy that requires asylum seekers to wait in Mexico while their cases make their way through the U.S. immigration court system.

“Nobody can believe these decisions we’re getting from the 9th Circuit,” Trump said as Sissi smiled beside him. “It’s a disgrace.”

Sissi has had his own problems with judges, and rights groups say he is now taking aim at Egypt’s once energetically independent judiciary. Mohamed Soltan, a human rights advocate jailed under Sissi and later freed, said Sissi is seeking cover from Trump for further constraints on an already compromised judiciary.

“We have stood idly by and watched the basic tenets of democracy erode in a nation we consider to be an ally and partner,” Soltan wrote in The Washington Post ahead of Sissi’s visit. “Surely, we cannot hold the final nail in the coffin as Sissi hammers away.”

Trump did not mention human rights concerns during the two leaders’ brief appearance before news cameras, and U.S. officials did not list human rights among top agenda items for the session.

But Secretary of State Mike Pompeo was challenged by Democratic senators about the administration support of Sissi during a hearing Tuesday.

In an exchange with Sen. Patrick J. Leahy (D-Vt.), Pompeo agreed that Venezuelan President Nicolás Maduro and North Korean leader Kim Jung Un were “tyrants” but said he would “not use that characterization” in reference to Sissi. Leahy, during an Appropriations subcommittee hearing, said that Sissi had “locked up opponents,” including American citizens, while seeking to stay indefinitely in power, and noted that Trump had called him “a great friend” earlier in the day.

“The president chooses his own words,” Pompeo replied. He sought to differentiate between “tyrants” and “authoritarian” leaders, while praising Sissi’s counterterrorism efforts in Sinai and “the way he held up religious freedom.” The administration was “asking [Sissi] to do better” on the issues Leahy raised, Pompeo said, “certainly with respect to [imprisoned] Americans.”

Sissi has sought out Trump from the start, calling him one day after the 2016 election seeking a reboot of what had become a tense relationship with the Obama administration marked by White House criticism of Sissi and a temporary hold on U.S. military equipment shipments to Egypt.

Egypt receives more than $1 billion in U.S. military aid annually, a figure Trump has not reduced despite his proposed slashing of the foreign aid budget.

Trump invited Sissi to stay at Blair House, across Pennsylvania Avenue from the White House, an honor usually reserved for close allies and partners.

But Trump was not attending a gala dinner for Sissi on Tuesday organized by the U.S. Chamber of Commerce, which scaled back the event and rescinded some invitations on short notice last week.

A White House fact sheet about the visit stressed Egypt’s role in promoting “Middle East stability,” noting cooperation in conflicts in Libya, Syria and Yemen and in combating terrorism. Egypt, the first Arab state to make peace with Israel, also is seen as key to a still-secret Israeli-Palestinian proposal drafted by Trump adviser Jared Kushner.

“The United States encourages the Egyptian government to preserve space for civil society and to protect human rights,” the White House summary said.

Sissi met with Pompeo on Monday and was seeing a few congressional leaders during three days in Washington.

State Department spokeswoman Morgan Ortagus said Pompeo raised “cases concerning U.S. citizens in Egypt,” a delicately worded reference to several Americans jailed in Egypt under Sissi.

Trump is credited with winning release of at least one American jailed in Egypt, in 2017, but he has not commented publicly on other cases including that of Moustafa Kassem, a New York taxi driver and dual citizen who has been jailed since 2013.

Vice President Pence raised Kassem’s case and one other when he met with Sissi in Cairo in January 2018. Kassem wrote to Pence and Trump months later, pleading for help before beginning a hunger strike, ABC News reported.

In an interview in January with CBS News, Sissi denied there are any political prisoners in Egypt.

On Tuesday there was little public evidence of any tensions at all between the two leaders.

“It’s a great honor to be with President al-Sissi — a friend, a great friend — of Egypt,” Trump said as he welcomed Sissi for their sixth face-to-face meeting. “We have very special things happening. Our relationship has never been stronger. And we’re working with Egypt on many different fronts, including military and trade.”

Sissi agreed.

“All the credit goes to you, Mr. President,” he said, as Trump smiled.

Karen DeYoung and John Hudson contributed to this report.