As archbishop of Buenos Aires, Cardinal Jorge Bergoglio got to know the challenges his church confronts in Latin America, home to the world's greatest concentration of Catholics.
He will have seen the secularism which has so afflicted the church in Europe spread across Latin America, once a bastion of the social conservatism promoted by the Vatican. Today ever more of the region's Catholics ignore their church's teachings on contraception and divorce, while leftist governments have started chipping away at anti-abortion laws.
Attack on government
In 2010, he bitterly attacked Argentina 's government when it became the first in Latin America to legalise same-sex marriages, denouncing the move as a "destructive attack on God's plan". But president Cristina Kirchner signed the bill into law and strolled to re-election the following year.
However, unlike Europe, Latin America poses another challenge – one diametrically opposed to that of secularism – the rise of conservative evangelical Protestant churches, especially among the poor.
Almost 40 per cent of the world's Catholics – 425.5 million – live in Latin America (see chart). But Rome's old monopoly over the region has been broken. Today only 72 per cent of Latin Americans describe themselves as Catholic, down from over 90 per cent a century ago.
Evangelical challenge
Much of this decline is due to the growth in influence of evangelical groups, most of which practise an exuberant, home-grown Latin version of Pentecostalism. In Guatemala their rise has been so rapid the country's Catholics fear they could soon be a minority.
In Brazil – the world’s most populous Catholic country – their emergence has also been rapid. Already more than a fifth of the population defines itself as evangelical Christian, while the percentage of Catholics has declined from 83 per cent in 1991 to just 64.6 per cent in 2010. If that trend continues, by 2030 less than half of Brazilians will be Catholic.
The phenomenon, say analysts, is the result of the chaotic transformation of Latin American society from a rural to urban one.
“Traditional connections were broken,” says Prof Orivaldo Pimental Lopes Jr, a Brazilian sociologist. “People felt at liberty to make choices that they had not in more traditional rural communities.”
Often they have felt free to do so because the church was slow to react to the growth of urban slums. Complacent after centuries of exercising a religious monopoly, it took for granted its hold over the region’s souls.
"What the Catholic church discovered was that, despite the evangelising work of its first missionaries, it had not put down deep roots," says Fr José Arnaldo Juliano dos Santos, a Catholic historian in Brazil.
Liberation theology
In 1968 Latin America's bishops acknowledged the need to get closer to the region's poor, turning to liberation theology to do so at their Medellín conference of that year. It led to a new vitality in the church as priests and lay workers formed so-called ecclesiastic base communities that lived and worked among the poor.
But the Vatican was suspicious of liberation theology, viewing it as infected with Marxism. After the election of Pope John Paul II, Rome worked to end the movement's influence.
The vitality of the 1970s was lost. Many priests and lay activists drifted away from the church whose leadership in Rome spent much of its energy in the subsequent decades enforcing doctrinal purity.
As the church looked inwards, millions turned instead to the evangelical churches whose so-called ‘Doctrine of Prosperity’ – that God will reward the good in this life as well as the next – chimed with an increasingly consumerist society.
The Latin American church has since sought to react to this challenge, placing greater emphasis on its pastoral mission. As a cardinal, Pope Francis was one of a number of Latin church leaders who called for a focus on social justice and reaching out to the poor.
But after the church losing so much ground recently, it remains to be seen whether this will be enough to stop the rot.