The visit was designed to forge Muslim-Christian brotherhood and show solidarity with the country's persecuted Coptic Christian minority.
Heavy security surrounded Francis as he entered Cairo's Air Defense Stadium in an open golf cart.
He waved at worshippers and stopped momentarily to bless a group of children in costume. Parts of the stadium stands were draped with his photo as well as Egyptian and Vatican flags.
"Religiosity means nothing unless it is inspired by deep faith and charity," Francis said.
"True faith is one that makes us more charitable, more merciful, more honest and more humane," 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."
The Pope started his Mass with the "As-Salaam Alaikum," the traditional Muslim greeting in Arabic that means "Peace be upon you," and ended it with "al-Masih qam! Bi-l-haqiqa qam! (Christ is risen! He is truly risen)".
A Vatican spokesman said 15,000 people attended the Mass at the stadium, which holds 30,000.
The Pope later met with members of Egypt's small Coptic Catholic community at St. Leo's Patriarchal Seminary in Cairo's Maadi neighborhood.
In a more intimate setting than his earlier Mass, Francis urged gathered priests, nuns and worshippers to be the religious builders of peace in Egypt, saying that despite "difficult circumstances, you must endure."
"Although there are many reasons to be discouraged, and many prophets of destruction and condemnation ... may you be the sowers of hope, builders of bridges and agents of dialogue and harmony," he said.
Later Saturday, Egyptian President Abdel Fattah el-Sisi and an honor guard met the Pope at the airport in a farewell ceremony before he departed for Rome.