Pope Francis on Sunday praised two of the towering figures of the 20th-century Catholic Church as prophets who shunned wealth and looked out for the poor as he canonized the modernizing Pope Paul VI and martyred Salvadoran Archbishop Oscar Romero.

Francis declared the two men saints at a Mass in St. Peter's Square before tens of thousands of pilgrims, a handful of presidents and some 5,000 Salvadoran pilgrims. Tens of thousands more Salvadorans stayed up all night at home to watch it on giant TV screens outside the San Salvador cathedral where Romero's remains are entombed.

In a sign of the strong influence Paul and Romero had on history's first Latin American pope, Francis wore the blood-stained rope belt that Romero wore when he was gunned down in 1980 and also used Paul's staff, chalice and pallium vestment.

San Salvador's Archbishop Oscar Arnulfo Romero was gunned down by right-wing soldiers on March 24, 1980 while he was saying mass at Hospital Divina Providencia in San Salvador. (Uri Cortez/AFP/Getty Images)

Paul presided over the modernizing yet polarizing church reforms of the 1960s, while Romero was murdered by El Salvador's right-wing death squads for his fearless defence of the poor.

In his homily, Francis called Paul a "prophet of a church turned outwards" to care for the faraway poor. He said Romero gave up his security and life to "be close to the poor and his people."

And he warned that those who don't follow their example to leave behind everything, including their wealth, risk never truly finding God.

"Wealth is dangerous and — says Jesus — even makes one's salvation difficult," Francis said.

"The love of money is the root of all evils," he said. "We see this where money is at the centre, there is no room for God or for man."

[Monsignor Romero] is a light for our people, an inspiration for all. - Salvadoran Aida Guzman

For many in San Salvador, it was the culmination of a fraught and politicized campaign to have the church formally honour a man who publicly denounced the repression by El Salvador's military dictatorship at the start of the country's 1980-1992 civil war.

"I am here to give glory to Monsignor Romero," said Aida Guzman, a 68-year-old Salvadoran woman who carried photos of people killed during the war as she joined thousands in a Friday evening procession in San Salvador. "He is a light for our people, an inspiration for all."

Romero, the archbishop of San Salvador, was murdered as he celebrated Mass on March 24, 1980, in a hospital chapel. A day before he was killed, he had delivered the latest in a series of sermons demanding an end to the army's repression — sermons that had enraged El Salvador's leaders.

Icon of the left

Almost immediately after his death, Romero became an icon of the South American left and is frequently listed along with Martin Luther King Jr. and Mohandas Gandhi as one of the world's most influential human rights campaigners. The United Nations commemorates the anniversary of his death each year.

But his popularity with the left led to a decades-long delay in his saint-making cause at the Vatican, where right-wing cardinals led by Colombian Cardinal Alfonso Lopez Trujillo warned his elevation would embolden Marxist revolutionaries on the continent.

Some 5,000 Salvadoran pilgrims travelled to Rome for the canonization ceremony. Here, Pope Francis poses with youth from the U.S.-based immigrant rights National TPS Alliance group. One of its members holds a portrait of Salvadorian archbishop Oscar Romero during the weekly general audience at St.Peter's square in the Vatican on Oct. 10. (Alberto Pizzoli/AFP/Getty Images)

Eventually Pope Benedict XVI unblocked the cause and Francis saw it through to its conclusion Sunday, including his determination that Romero was a martyr for the church — killed out of hatred for the faith and for preaching the Gospel, even though his assassins were Catholics like him.

Romero's influence continues to resonate with El Salvador's youth as the country endures brutal gang violence that has made the Central American nation one of the most violent in the world.

"He is my guide, and from what I have read about his life, I want to follow in his steps," said Oscar Orellana, a 15-year-old who joined the San Salvador procession wearing a white tunic like the one Romero used to wear.

Second Vatican Council

Paul VI, for his part, is best known for having presided over the final sessions of the Second Vatican Council, the 1962-65 church meetings that opened up the Catholic Church to the world. Under his auspices, the church agreed to allow liturgy to be celebrated in the vernacular rather than in Latin and called for greater roles for the laity and improved relations with people of other faiths.

Paul is also remembered for his two most important encyclicals, or teaching documents, that have had a profound effect on the church: One, "The Progress of Peoples" denounced the mounting inequality between rich and poor, and the other, "Humanae Vitae," reaffirmed the Catholic church's opposition to artificial contraception.

The stark prohibition against contraception like birth control pills or condoms empowered conservatives but drove progressives away. Even today, studies show that most Catholics ignore that teaching and use contraception anyway.

Francis was deeply influenced by Paul, who was the pope of his formative years as a young priest in Argentina and was instrumental in giving rise to the Latin American church's "preferential option for the poor."

Francis has also adopted the "church of the poor" ethos that Paul embodied when Paul formally renounced wearing the bejewelled papal tiara.

Paul is also very important to another pope, Emeritus Pope Benedict XVI, whom Paul made a cardinal in 1977. There had been speculation that the 91-year-old Benedict might attend Sunday's canonization, but officials said he has recently weakened. Instead, Francis paid a visit to Benedict at his home in the Vatican gardens on the eve of the Mass.