But beyond the sometimes saccharine tributes, the thorny challenges of religious harmony in Egypt were felt.

At a carpet store across the street, an older woman held court after Francis had driven off. Egyptians welcomed him, as they would any foreign visitors, she said. “But we wish they would love us back,” she added, launching into a stream of gripes against former President Barack Obama and other foreigners who, she said, were “against Egypt.”

The woman declined to give her name, citing her suspicions of the American news media.

The pope prods Sisi on human rights.

In an address to Mr. Sisi and a collection of political and civil authorities, Francis gently sought to encourage the authoritarian government’s progress in protecting Egypt’s religious minorities while at the same time making subtle, diplomatic but nevertheless clear allusions to the leader’s crackdown on human rights.

“Some minutes ago you told me that God is the God of liberty,” Pope Francis said, turning to look at Mr. Sisi, who sat on stage next to the pontiff. “And this is true.”

After remarks by Mr. Sisi in front of the Egyptian and Vatican flags at Al Masah Hotel, the pope, speaking only minutes after a long address at Al Azhar’s conference, congratulated the Egyptian government on its efforts toward economic and social development. He recognized Mr. Sisi for having spoken “often” and “with a clarity” against a religious extremism that crushes diversity. But then he pointedly argued that “history does not forgive those who preach justice, but then practice injustice; history does not forgive those who talk about equality, but then discard those who are different.”

Francis also called for the ensuring of “unconditional respect for inalienable human rights such as equality among all citizens, religious freedom and freedom of expression, without any distinction.” He argued that Egypt had a “unique role to play” as a bulwark against spreading violence in the region, “even as it is assaulted on its own soil by senseless acts of violence.”

Francis mourns martyrs at Coptic cathedral.

After riding in a car along seemingly empty streets, Francis went to the Coptic Orthodox Cathedral festooned in banners hailing his arrival. There, the pope, wearing white, met with his counterpart, Tawadros, dressed in black, and said their ever closer bond was “sustained, in mysterious and quite relevant way, by a genuine ecumenism of blood.”