VATICAN CITY (AP) -- When Cardinal Jorge Mario Bergoglio almost became pope in 2005, he told a confidant that -- had he been elected -- he would have named himself after the pope he so admired: John XXIII.
When he did become pope in 2013, his first public words echoed what John Paul II had said upon his election -- that cardinals had searched far, to the "ends of the Earth," to find a new leader.
John XXIII and John Paul II, two of the 20th century's great spiritual leaders, changed the face of the Catholic Church and the papacy itself with their remarkable, and remarkably different, papacies. They also had a profound influence on Pope Francis, who will declare them both saints Sunday in history's first canonization of two popes.
John, embraced by progressives, reigned from 1958-1963 and is credited primarily with having convened the Second Vatican Council, which brought the 2,000-year-old institution into modern times. During his 26 years as pope, John Paul ensured a more conservative implementation and interpretation of the council, while helping to bring down communism and energizing a new generation of Catholics.
Just weeks after he was elected, Francis prayed at the tombs of both men -- an indication that he feels a great personal and spiritual continuity with them.
"To canonize them both together will be, I believe, a message for the church," Francis said last summer. "These two were wonderful, both of them."
Francis owes his papacy -- and his career -- to John Paul, who was elected in 1978 as the first non-Italian in 455 years.
It was John Paul who plucked Bergoglio from relative obscurity and from internal Jesuit exile to make him an auxiliary bishop of Buenos Aires in 1992. Six years later, John Paul promoted Bergoglio to archbishop of the Argentine capital and in 2001 made him a cardinal, putting him in the running to possibly succeed him as pope.
In Bergoglio, John Paul probably saw a kindred spirit, a conservative who like John Paul opposed the Marxist excesses of liberation theology in Latin America.
Bergoglio later testified before the church tribunal for John Paul's saint-making process that his pope had been "heroic" in his suffering as he battled Parkinson's disease in his later years. He said his own devotion to the Virgin Mary was due in part to John Paul's great devotion to the Madonna.
But in many ways, Francis is much more a pontiff in the style of John XXIII.
Francis' emphasis on a "poor church," on internal church reform and spreading the faith to the peripheries of society echoes the concerns of John XXIII.
The young Angelo Roncalli joined the Franciscan order's lay branch before being ordained, drawn to the emphasis of its founder St. Francis of Assisi on caring for the poor and his message of peace. The current pope eventually decided to name himself after St. Francis, signaling a deep spiritual connection.
In a sentimental sign of his admiration for John XXIII, Francis included John's longtime private secretary, Loris Capovilla, in his first batch of new cardinals, even though at age 98, Capovilla was well over the age limit to vote in a conclave.
Francis was similarly so determined to see John made a saint that he broke the Vatican's own rules for canonization, declaring that the Vatican need not go through the process of certifying a second miracle attributed to his intercession.
"Francis is a Roncallian pope," said Alberto Melloni, John's biographer and the head of the Bologna foundation where his papers are kept. "We see the fruit of the council today in Pope Francis."
MISSIONARIES OR MORALIZERS?
Francis is a pastor pope like John, and less doctrinaire than John Paul.
Francis once quipped, when asked why he didn't raise abortion and same-sex marriage during his first foreign trip to Brazil, that he didn't feel it necessary -- "just as I didn't speak about cheating, lying, or other matters on which the church has a clear teaching!"
Had John Paul not spent the better part of a quarter-century clarifying church teaching on issues such as abortion, euthanasia and homosexuality for a generation of Catholics confused after the turbulent 1960s, Francis perhaps might not have felt that way. But the remark also points to Francis' forgiving focus on mercy over morals.
That's not to say that John Paul was all doctrine. On the contrary, his globe-trotting papacy, his foresight to launch the wildly popular World Youth Days and his natural ability to communicate all made him the world's Catholic pastor on a global altar.