Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Pope Francis called for a retreat from "fanaticism” during Mass in the Egyptian capital Saturday, the last day of a key visit during which he addressed religious violence and the plight of the region's beleaguered Christian communities.

Thousands of believers held yellow balloons, the color of the Vatican flag, at the military run stadium in Cairo.

“True faith leads us to protect the rights of others with the same zeal and enthusiasm with which we defend our own,” he told the crowd of some 15,000 people. "The only fanaticism believers can have is that of charity. Any other fanaticism does not come from God and is not pleasing to him.”

A military helicopter is seen as Pope Francis leads a mass in Cairo on Saturday. ALESSANDRO BIANCHI / Reuters

The pontiff's two-day visit — aimed at improving Christian-Muslim ties and forging a united front against religious extremism — comes at a critical time for the region, caught in a spiral of extreme violence.

The trip also comes at a turbulent time in Egypt.

President Abdel Fattah al-Sisi, who has vowed to crush Islamist extremist and is fighting a long-running insurgency in North Sinai, has come under criticism for suppressing opposition and human rights.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

And in recent months, Egypt’s ancient minority of Coptic Christians have come under intensifying attack. On April 9, at least 44 people died after two churches in different cities were bombed during services for Palm Sunday. ISIS claimed responsibility for the attacks.

“This is probably the worst it has ever been,” Dr. H.A. Helleyer, a senior non-resident fellow at the Atlantic Council, a Washington-based think tank, told NBC News at the time. “But that’s not to say things were necessarily rosy before.”

Speaking on Friday at a peace conference at the Al Azhar mosque and university, an important center for Sunni Islamic learning, the pope called for an end to all violence and to cloaking aggression in the language of religion.

“Let us say once more a firm and clear 'No!' to every form of violence, vengeance and hatred carried out in the name of religion or in the name of God. Together let us affirm the incompatibility of violence and faith, belief and hatred,” the pope said.

“Mr. President, a few minutes ago you told me God is the God of liberty. And this is true.”

Later on Friday the pontiff seemingly addressed issues of governance and human rights while speaking to an audience including Sisi.

Sisi seized power in 2013, ousting the elected Muslim Brotherhood and its Islamist supporters from office in a bloody coup. He has been widely criticized by human rights groups for overseeing a vicious crackdown on dissenters, imprisoning his rivals and muffling the free press.

“Under al-Sisi’s presidency, his security forces have arrested tens of thousands of Egyptians and committed flagrant rights abuses, including torture, enforced disappearances, and likely extrajudicial executions,” a recent report from Human Rights Watch said. The report, published ahead of Sisi's visit to Washington D.C. earlier this month, described the current situation in Egypt as a “nadir for basic freedoms.”

In remarks widely reported as pointed at the Egyptian president the pope said, “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.”

Worshippers wearing ancient Egyptian costumes watch a mass celebrated by Pope Francis on Saturday. ANDREAS SOLARO

He also urged for "unconditional respect for inalienable human rights such as equality among all citizens, religious freedom and freedom of expression, without any distinction."

And speaking off-script the pope turned to look at Sisi saying: “Mr. President, a few minutes ago you told me God is the God of liberty. And this is true.”

The pontiff also acknowledged that Sisi had spoken "with a clarity that merits attention and appreciation" against extremism, which destroys diversity.

The visit was the first by Pope Francis to Cairo but the second by a Vatican pope. Pope John Paul II came to Egypt in 2000, a year before the Sept. 11, 2001, attacks on the United States that convulsed Western relations with the Muslim world.

Egypt's Christians comprise roughly 10 percent of the 92 million population — making them by far the largest Christian community in the Middle East. Most of Egypt's Christians are Coptic Orthodox with barely 200,000 members of Churches within the Roman Catholic fold.