The pontiff's hard-hitting speech may have made uncomfortable listening for his host, President Pedro Pablo Kuczynski
Visiting Peru, Pope Francis has given one of his most forceful condemnations yet of corruption, calling it a social "virus".
He spoke out alongside Peruvian President Pedro Pablo Kuczynski who has himself been tainted by scandal.
"Everything being done to combat this social scourge deserves our utmost attention and help ... This is a battle that involves all of us," the head of the Roman Catholic Church said in a speech outside the presidential palace in Lima on Friday.
Latin American countries from Brazil to Argentina and Mexico have been gripped by corruption scandals involving billions of dollars of graft and high-level politicians and executives, many tied to Brazilian construction firm Odebrecht.
In Peru, a former president has been detained, while Kuczynski was nearly impeached in December for not revealing that a company he used to run did business with Odebrecht. Kuczynski denies wrongdoing.
Days after surviving an impeachment vote, Kuczynski pardoned ex-president Alberto Fujimori less than halfway through his 25-year sentence for graft and human rights abuses, in what was widely seen as a political deal to allow Kuczynski to stay in office.
Kuczynski, 79, cited medical reasons for granting Fujimori the pardon and has said it was fundamentally about forgiveness. He denies it was part of a backroom deal.
Kuczynski has welcomed Francis, saying Peru was healing the wounds of 30 years ago and the pope's visit had given the country a push towards peace and dialogue.
Facing Kuczynski, a former Wall Street banker, the pope said corruption was preventable, and required a commitment from all.
"I encourage and urge all those in positions of authority, in whatever sphere, to insist on this path in order to bring your people and your land the security born of feeling that Peru is a place of hope and opportunity for all, and not just for a few," he said to applause.
Also on Friday visiting a corner of the Amazon in Peru, Francis issued a ringing defence of the local people and environment, saying that big business and "consumerist greed" cannot be allowed to destroy a natural habitat that is vital for the entire planet.