Pope Francis has headed back to Rome, wrapping up a visit to the US where he met victims of abuse by Catholic priests, visited a prison, and praised the family as a "factory of hope" during an open-air mass on the final day of his trip.

He ended his trip late on Sunday in Philadelphia, where he told a group of victims of child sexual abuse that "God weeps" for their suffering.

"I promise that all those responsible for the sexual abuse of children will be punished," Francis told a gathering of bishops, after meeting for about 30 minutes with three women and two men who were sexually abused by clergy members.

Saying he felt "deep shame" about the acts, Francis, 78, told the audience that "these crimes can no longer be kept secret".

An Argentine mother's plea to save her son

The Catholic Church has been tarnished in recent years by worldwide revelations about paedophile priests and by allegations that its hierarchy failed to punish offenders and covered up their crimes for decades.

The pope also met 100 inmates at a Philadelphia jail. He advised them to try and make the most of their time behind bars.

"This time in your life can only have one purpose: to give you a hand in getting back on the right road, to give you a hand to help you rejoin society."

Francis' last day in the US was capped with a mass for hundreds of thousands of people.

It was the culmination of a trip that also featured a meeting with US President Barack Obama, and addresses to the US Congress and the UN.

Francis spent six days with packed itineraries in Washington, New York and Philadelphia after a four-day visit to Cuba, where he met the country's retired revolutionary leader, Fidel Castro.

Source: Al Jazeera and agencies