More than 1 million people turned out Sunday for Pope Francis’ final Mass in Peru, giving him a warm and heartfelt farewell that contrasted sharply with the outcry he caused in neighboring Chile by accusing sex abuse victims of slandering a bishop.

Cardinal Sean O’Malley of Boston, who publicly rebuked the pope on Saturday for those remarks, joined the pontiff and dozens of fellow bishops on a tented altar at a Lima airfield to celebrate the Mass. The crowd of 1.3 million people reported by the Vatican was the largest of Francis’ weeklong, two-nation visit.

Francis tried to move beyond the scandal Sunday, joking with cloistered nuns that they were taking advantage of his visit to finally get out and get a breath of fresh air. And he denounced a corruption scandal in Latin America that has even implicated his Peruvian host, President Pedro Pablo Kuczynski, who recently survived an impeachment vote by lawmakers.

In his homily Francis referred to the “grave sin of corruption,” that kills the hope of people, urging Peruvians to have hope and show tenderness and compassion.

Thousands lined the streets as his black papal Fiat made its way to the airport, where a children’s choir sang in farewell as Francis boarded a plane to head back to Rome.

Earlier in the day, he said the bribery scandal centered on Brazilian construction giant Odebrecht was “just a small anecdote” of the corruption and graft that have thrown much of Latin American politics into crisis.

“If we fall into the hands of people who only understand the language of corruption, we’re toast,” the pope said in unscripted remarks.

Francis was greeted by cheering crowds at nearly every stop of his Peru trip, but the cloud of sex abuse scandal trailed him.

“Francis, here there IS proof,” read a banner hanging from a Lima building along his motorcade route Sunday.

The message was a reference both to Peru’s own abuse scandal and to Francis’ Jan. 18 comments in Iquique, Chile, that there was not “one shred of proof” to allegations that a protege of that country’s most notorious pedophile priest, the Rev. Fernando Karadima, knew of Karadima’s abuse and did nothing to stop it.

Karadima’s victims have accused the bishop, Juan Barros, of witnessing the abuse and of complicity in covering it up. Barros has denied the accusations, and Francis backed him by saying the victims’ claims were “all calumny.”

Francis’ remarks that he would only believe victims with “proof” were problematic because they were already deemed so credible by the Vatican that it sentenced Karadima to a lifetime of “penance and prayer” in 2011 based on their testimony. A Chilean judge also found the victims to be credible, saying that while she had to drop charges against Karadima because too much time had passed, proof of his crimes wasn’t lacking.

The pope’s comments sparked such an outcry that both O’Malley, Francis’ own top adviser on abuse, and the Chilean government made the highly rare decision to publicly rebuke him — an extraordinary correction of a pontiff from both church and state. The criticisms were all the more remarkable given that they came on the Argentina-born pontiff’s home turf in Latin America.

O’Malley said Saturday that Francis’ remarks were “a source of great pain for survivors of sexual abuse,” and that such expressions of disbelief made abuse survivors feel abandoned and left in “discredited exile.”

Chilean government spokeswoman Paula Narvaez said there was an “ethical imperative to respect victims of sexual abuse, believe them and support them.”

The issue also had resonance in Peru. Last week the Vatican took over a Peru-based Roman Catholic lay movement, Sodalitium Christianae Vitae, more than six years after first learning of sexual, physical and psychological abuse committed by its founder.

An independent investigation commissioned by the movement found that founder Luis Figari sodomized his recruits, forced them to fondle him and one another, liked to watch them “experience pain, discomfort and fear” and humiliated them in front of others. Figari’s victims have criticized the Vatican for its years of inaction and for eventually sanctioning him with what they consider a “golden exile” — retirement in Italy at a retreat house, albeit separated from the community he founded.

The banner hanging from the building along Francis’ motorcade route referred to evidence against Figari and featured a photo of him. Peruvian prosecutors recently announced they wanted to arrest him.

But for the most part, Peruvians welcomed him with open arms and flooded in huge droves to his final Mass. In contrast, Francis’ send-off from Chile drew only 50,000 people, a fraction of the number expected.

“He is a symbol to us as Catholics,” said Cindy Sanchez, a 24-year-old administrative assistant attending the Mass. “Listening to him gives us encouragement.”

During his seven-day trip in Chile and Peru, Francis personally apologized to survivors of priests who sexually abused them, traveled deep into the Amazon to meet with indigenous leaders, decried the scourge of violence against women in Latin America and urged the Chilean government and radical factions of the Mapuche indigenous group to peacefully resolve one of the region’s longest-running disputes.

But the pope also attracted unprecedented rejection: At least a dozen churches across Chile were set aflame, and riot police shot tear gas at and arrested protesters in the capital, Santiago.