Pope Francis met with victims of child sexual abuse Sunday on the final day of his U.S. visit and promised to hold accountable those responsible for the scandal in the church, delivering a powerful warning to American bishops accused of covering up for pedophile priests instead of reporting them to police.

In a gesture of reconciliation just hours before he was to return to Rome, the pontiff praised the victims as “true heralds of mercy” who deserve the church’s gratitude for helping to bring the truth to light.

“God weeps, for the sexual abuse of children cannot be maintained in secret, and I commit to a careful oversight to ensure that youth are protected and that all responsible will be held accountable,” Francis said in Spanish while in the City of Brotherly Love for a big festival on the Catholic family.

It was Francis’ second such meeting: He met with sexual abuse victims at the Vatican in July 2014.

But in a move that signaled a new effort by the church to reshape the discussion, the Vatican said not all five of the victims at Sunday’s meeting were abused by members of the clergy; some of the three women and two men had been victimized by family members or educators.

Later Sunday, Francis visited a Philadelphia jail to give hope and encouragement to about 100 inmates, included suspected killers, rapists and mobsters. He greeted the men one by one, along with their families, telling them to spend their time behind bars getting their lives back on track.

In the afternoon, Francis was scheduled to celebrate a final Mass on U.S. soil on Philadelphia’s grandest boulevard, the Benjamin Franklin Parkway, with organizers predicting a crowd of 1 million.

It was expected to be the biggest event of his six-day U.S. trip, a journey that also took him to Washington and New York, where he addressed Congress and the United Nations and called for urgent global action on climate change and poverty.

The Archdiocese of Philadelphia has been hit hard by the sexual abuse scandal and has been the subject of repeated grand jury investigations, including one that accused it keeping on assignment more than three dozen priests facing serious accusations. A monsignor was found guilty of endangering children by not removing pedophile priests, becoming the first American church official convicted of such an offense.

The pope has agreed to create a new Vatican tribunal to prosecute bishops who failed to protect their flock, and he has accepted the resignations of three U.S. bishops accused of mishandling cases. During the previous meeting with victims, he similarly vowed to hold bishops accountable.

But Francis and U.S. bishops have also argued that child molestation is a serious problem beyond the church, especially within families and in schools. The meeting with victims abused by people other than priests underscored that point.

Victim support groups were unimpressed by Sunday’s meeting, which took place a day after the pope celebrated Mass with Cardinal Justin Rigali, who was archbishop in Philadelphia when the archdiocese was accused of sheltering pedophiles.

The main victims’ support group, SNAP, dismissed the meeting as an exercise in public relations.

“Is a child anywhere on Earth safer now that a pope, for maybe the seventh or eighth time or ninth time, has briefly chatted with abuse victims? No,” said SNAP’s David Clohessy.

The Rev. Tom Doyle, a canon lawyer who worked at the Vatican embassy in Washington and is now an advocate for victims, said that including more than just victims of abusive clergy “seriously minimizes” the problem in the church.

“We don’t think we’re going to get any real support to change this from the leadership in the Vatican,” Doyle said in a phone interview. “They’re having this big meeting of families. But there’s been no real room for all the families that the Catholic Church has destroyed through sexual abuse.”

The Vatican spokesman, the Rev. Federico Lombardi, said the pope met with the survivors for a half-hour at the San Carlo Borromeo seminary. He said the pope prayed with them, listened to their stories and expressed his closeness in their suffering and his “pain and shame” in the case of those abused by priests.

Also Sunday, during a meeting with American bishops in town for the family festival, Francis referred to gay marriage for the first time in his U.S. trip, lamenting the new reality in which Christians must live.

But he also urged the bishops to redirect their energies away from complaining about it, saying a church that only explains its doctrine is “dangerously unbalanced.”

“I would even say that it is stuck in a vicious circle,” he said.

The U.S. bishops have spent considerable time and resources battling gay marriage, calling its legalization by the U.S. Supreme Court three months ago “a tragic error” and “profoundly immoral and unjust.”

During the pope’s jail visit, the blue-uniformed men and women, some of them heavily tattooed, seemed moved by the encounter. They clasped Francis’ hands and two gave him a hug. Some spoke to him in Spanish. They also presented him with a basket of jail-grown vegetables.

“May you make possible new opportunities, new journeys, new paths,” he said, standing before a wooden chair the inmates had made for him for the occasion.

The pope has criticized prison systems that only punish and humiliate prisoners, and he has denounced life prison terms and isolation as a form of torture. During his speech to Congress, he called for the abolition of the death penalty.

Hours before Sunday’s Mass, Roman Catholics from across the country and around the world began trekking into the city, crossing bridges on foot and packing subway cars.

But there were fears that the extraordinary security — including airport-style bag searches, crowd-control cattle chutes and blocked-off streets — would scare many people away and result in a turnout far below organizers’ expectations.

Thomas Coorey, a dentist and father of four visiting Philadelphia from Sydney, called Francis “the most inspirational and amazing pope that could breathe life into this church of mine. And I’m so grateful to have a leader like him who’s so humble and such a true servant of God.”

It has been a common sentiment throughout the pope’s American visit.

“It’s the wave. It’s the smile,” said Tom Hambrose, 52, of Haddon Heights, New Jersey. “It’s what he’s articulating, that the church needs to step forward and needs to change its thinking about things.”