"Everyone was really touched with his sincerity," said Vivian Gobran, 41, of Cairo, after attending a Mass that Francis celebrated at the suburban Air Defense Stadium on Saturday before he departed. "He brought his blessing to Egypt."
"As I leave Egypt, I wish to express my deep gratitude to your excellency and to all the beloved Egyptian people for your warm welcome and hospitality," said the pope in a farewell message to President Abdel Fattah Sisi. "With the assurance of my prayers, I invoke upon the nation the divine blessings of peace and joy."
More than 20,000 people flocked to the stadium, including Christians from Egypt as well as migrants from Brazil, Ethiopia, Sudan, Venezuela and the Philippines.
Francis entered the stadium to applause as a fleet of balloons of yellow and white — the Vatican colors — was released and a choir sang "Gloria."
Martin Ermano held a golden cross aloft as the pope arrived.
"I wasn't afraid to come to the Mass. I knew it would be good security," said Ermano, 54, a South Sudan native working as a Catholic missionary. "I hope the pope can establish peace, security and unity among Muslims and Christians."
The Mass was conducted in Latin, Italian and Arabic with some chants in Coptic. Children in historical Egyptian costumes lined up in front of a makeshift altar in the grass.
Ellie Monsivais moved to Egypt six months ago from Mexico and missed the pope's visit there. She said his visit to Egypt was more important because of recent attacks on churches in Egypt.
"He came at a critical time in Egyptian history," she said.
Soldiers patrolled outside the stadium, tanks parked on a nearby hillside and military helicopters circled overhead. But the mood remained festive, with songs and chants filling the air.
"Even without entering, by the sound of the music you can feel the joy," said Father Raymond Tumba, a Nigerian priest studying Arabic in Cairo, as he made his way into the stadium. "Wherever he goes, he spreads the message of peace."
Like many in the crowd, James Bolden picked up a free, white Pope Francis cap and scarf featuring "Pope of peace in Egypt of peace" logos from the visit.
A refugee from South Sudan who teaches fellow refugees at a Catholic school in Cairo, Bolden called Francis "the pope of refugees."
"He supports peace so conflicts don't happen that create refugees," said Bolden, 32.
Sister Charlotte Greer, a Palmdale native who moved to Egypt to serve as principal of St. Clare's College, saw the pope just as he left for the airport from the seminary, which was being guarded by riot police.
"We waved and waved and he actually slowed and stuck his head out," she said, and the crowd chanted "Viva il Papa!"
Father Rafic Greiche, parish priest at St. Cyril's in suburban Heliopolis, was among those who greeted the pope at the airport and saw him again at the seminary before he left Egypt. Meeting with the clergy, Francis was more relaxed than during the formal portions of the trip, Greiche said, cracking jokes and laughing before giving benedictions to the assembled nuns and priests.
"He was happy to be in connection with the people," Greiche said.
Worshipers were unafraid despite the twin suicide bombings at churches on Palm Sunday that killed 47 people in two Egyptian cities.
"God will protect us," said Nada Youssef, 30, as she clutched the free ticket she received through her church and waited to clear metal detectors stationed at every entrance. Cellphones were not allowed inside.
Some recalled seeing Pope John Paul II celebrate Mass in the last papal visit here, 17 years ago. Others said they brought their children born since then so they too could see the pope.
Fawzaya Alban and other women from South Sudan living in Cairo wore white clothing printed with the images of popes and priests, hoping for a blessing during Mass and grateful Francis was brave enough to visit.
"He visits all countries with suffering, countries with problems," said Alban, 42.
Maria Cormack said the pope set an example by refusing to cancel his visit after the church bombings.
"It's showing us the courage we need to stand against people trying to make us afraid," she said.
Cormack, 42, moved to Cairo 11 years ago and brought a sign to Mass for her troubled native land: "Pray for Venezuela."
"I feel safer here than in Venezuela now," she said.
Pope Francis waved to the crowds as he circled the stadium grounds in a golf cart. Some nuns held "Pope of Peace" signs, while other onlookers waved Holy See and Egyptian flags.
Francis began the Mass as he did his address to religious leaders at Al Azhar conference center the day before, with a traditional Arabic greeting that again provoked instant applause: "Peace be with you."
During Mass, Francis urged the faithful to transcend their divisions.
"Unless we tear apart the veil clouding our vision and shatter the hardness of our hearts and our prejudices, we will never be able to recognize the face of God," he said.
"God is pleased only by a faith that is proclaimed by our lives, for the only fanaticism believers can have is that of charity. Any other fanaticism does not come from God and is not pleasing to him," Francis said.
During his visit, Francis managed the delicate balance of embracing Islam while condemning Islamic extremists in the Muslim majority country. Christians are Egypt's largest religious minority, comprising 10% of the total 92 million population, and this year they have been targeted by Islamic State, been chased from their homes and seen their churches bombed.
Sisi lauded the pope during their meeting Friday, expressing appreciation for "his noble humanitarian positions which unleash the power of hope in the hearts of people."
Hosting the pope, he told Francis, "is a declaration to the world of the strength of our national unity."
"Eradicating terrorism requires a comprehensive strategy that takes into account not only military and security measures but also developmental, intellectual and political aspects," Sisi said.
The tension was palpable on Cairo's streets. Police lined the pope's motorcade route. Small groups of onlookers gathered to cheer as the pontiff passed, a fraction of the crowds he normally draws.
But the trip ended without incident. After Mass, Francis lunched with Catholic bishops, then met with priests, nuns and other religious leaders at St. Leo the Great Coptic Catholic Patriarchal Seminary before departing for Rome at 5 p.m.
Many said Francis embodied the motto of his trip, plastered on signs across the city: "The pope of peace in Egypt of peace."
"It's not just a slogan: We really felt it," said Afaf Boctor, 50, a Catholic who traveled 75 miles from upper Egypt to attend. "We love him very much."
Special correspondent Makarios Nassar in Cairo contributed to this report.
2:05 p.m.: This article was updated with comments from people at the event.