Pope Francis has left Peru after celebrating an open air Mass for more than one million people in the capital.
In the final hours of his six-day visit which began in Chile, Francis warned that much of Latin America was in deep crisis from corruption scandals and greed run amok and that society and the Church needed to work to combat it.
"A society unable to accept its suffering members and incapable of helping to share their suffering and to bear it inwardly through 'compassion' is a cruel and inhuman society."
The Mass ended a visit which has been marked by tough talk on corruption but also a backlash over what many see as the pontif's insufficient resolve to tackle sexual abuse in the Church.
In Chile Francis sparked outrage by saying criticism of a bishop he appointed who is accused of protecting a pedophile was "all slander."
But in Peru where Francis had a more enthusiastic reception he was wished a warm farewell as he left to fly back to Rome.