MEXICO CITY— Pope Francis opened his five-day trip to Mexico with praise for the country’s multicultural society, but also denouncing corruption both in government and in the Church, blasting the drug trade, and defending immigrants.

The raucous welcome Francis received from cheering Mexicans who lined his motorcade route seven-deep contrasted sharply with his pointed criticism of how Church and state leaders here have often failed their people, especially the poorest and most marginalized.

When “we seek the path of privileges or benefits for a few to the detriment of the good of all,” Francis said Saturday, “sooner or later the life of society becomes a fertile soil for corruption, the drug trade, exclusion of different cultures, violence and also human trafficking, kidnapping and death, bringing suffering and slowing down development.”

His comments came in a speech to civil authorities. After that gathering, Francis met with Mexican bishops, thanking them for their efforts to “confront the challenge of our age: migration.”

But he didn’t spare them, either. In a hard-hitting speech, Francis challenged Church leaders known for their deference to Mexico’s wealthy and powerful to courageously denounce the “insidious threat” posed by the drug trade and not hide behind their own privilege and careers.

He told them to be true pastors, close to their people, and to develop a coherent pastoral plan to help Mexicans “finally escape the raging waters that drown so many, either victims of the drug trade or those who stand before God with their hands drenched in blood, though with pockets filled with sordid money and their consciences deadened.”

The speech was met with tepid applause, with only a handful of bishops standing in ovation.

In what could be considered a preview of the address he’ll deliver on Wednesday, when he travels to Ciudad Juarez on the U.S.-Mexico border, Francis spoke of the millions “of sons and daughters of the Church” who live in exile “journeying to the north in search of new opportunities.”

“So many families are separated,” he said, “and integration into a supposedly ‘promised land’ is not always as easy as some believe.”

Francis spent most of Friday on a plane to Havana, where he held an historic meeting with Russian Orthodox Patriarch Kirill, the first-ever meeting between two leaders of those churches.

He arrived in Mexico after nightfall and was welcomed by a rapturous crowd at the airport that repeatedly chanted, “Francis, brother, you’re already Mexican.”

Along the 14 miles from the airport to the Vatican residence where he’s staying during the trip, hundreds of thousands of Mexicans lighted the path of the popemobile with their mobile phones.

On Saturday, Francis’ first public appearance was at the door of the residence, and before departing he spent several minutes greeting a crowd that demanded he give a blessing.

Mid-morning on Saturday, Francis addressed political, social, and cultural leaders in the Presidential Palace, becoming the first pope in seven papal visits to set foot in this building. (For decades, Mexico was under strict anti-clerical laws that would have made such an appearance by a pontiff problematic.)

Speaking in a country with the world’s second largest Catholic population, Francis said Christians are called to build a society in which “no one feels a victim of a throwaway culture.”

“Starting with those who call themselves Christians,” Francis said, “it is a commitment to which all of us must give of ourselves, for the construction of a political life on a truly human basis.”

The pope also called for the politicians to offer all citizens the opportunity to be “worthy contributors of their own future,” so they can have “real access to the material and spiritual goods which are indispensable: adequate housing, dignified employment, food, true justice, effective security, a healthy and peaceful environment.”

Francis also noted that half of the Mexican population is young, with 85 percent of the population under 54, and half of that is under 24. This, he said, makes it possible for Mexico to plan for the future.

“A people with a youthful population is a people able to renew and transform itself,” he said, defining Mexico’s youthfulness as an “encouraging human resource.”

After meeting politicians, Francis traveled to the Cathedral of the Assumption in Mexico City, where he told the country’s bishops “not to fear transparency.”

“The Church does not need darkness to carry out her work,” the pope told his prelates. “Be vigilant so that your vision will not be darkened by the gloomy mist of worldliness; do not allow yourselves to be corrupted by trivial materialism or by the seductive illusion of underhanded agreements.”

The Catholic hierarchy in Mexico has denounced corruption on several occasions, but critics say the bishops haven’t always had clean hands themselves. Just before Francis arrived in the country, for instance, a scandal erupted based on suggestions that Church officials dubiously annulled the marriage of Mexico’s First Lady, based on hopes for political favors down the line.

As he’s done many times before, Francis asked the bishops to avoid “gossip or intrigue, conceited schemes of careerism in empty plans of superiority, in unproductive groups that seek benefits or common interests.”

“Observing your faces,” the pope told them, “the Mexican people have the right to witness the signs of those ‘who have seen the Lord’.”

Francis urged the prelates not to “underestimate the moral and anti-social challenge” presented by drug trafficking, adding that it doesn’t allow pastors “to hide behind anodyne denunciations.”

The gravity of the situation, the pope said, demands “prophetic courage” and a “reliable and qualified pastoral plan.”

In his 4,000-plus word address to the bishops, Francis also asked them to show “singular tenderness” to indigenous peoples and their “fascinating, but not infrequently decimated, cultures.”

Mexico is home to 58 indigenous communities, and the pope is set to meet many of them on Tuesday when he visits the state of Chiapas, one of the poorest zones of the country where more than 70 percent of the population is indigenous.

Francis revisited some of the turbulent past of Church-State relations in Mexico, saying that some may want the Church to be relegated to an inferior position, “as for example when its voice was silenced and efforts were made to eradicate it.”

Twice in its history, Mexico was divided by a civil war, and both times it was due to laws that restricted ecclesiastical privileges, confiscated Church properties, suppressed religious orders and empowered governors to designate what buildings could be used for religious services.

The constitution of 1917 highlighted and institutionalized many of the 19th-century secular reforms, heavily restricting religious freedom. Beginning in 1926 and continuing until the late 1930s, various federal and state administrations strenuously enforced the constitution, paving the way to the bloody Cristero Rebellion in western Mexico.

Churches were closed, priests were required to marry if they were to celebrate Mass, and in the state of Chihuahua, only one priest was allowed to minister to the entire statewide Catholic population.

That legacy had a long shelf-life. For instance, when Pope John Paul II in 1979 made his first pilgrimage to Mexico, priests were still legally banned from wearing clerical collars in public, owning property, or voting.

Government officials actually claimed that John Paul was violating Mexican law by wearing his cassock, but in a gesture that illustrates the complex Church-State relations, then-President José Lopez Portillo offered to pay the 50-peso fine.

Although relations between the two improved after that first papal visit, it wasn’t until 1992 that Mexico and the Vatican restored diplomatic relations that had been severed in 1917.

“You stand on the shoulders of giants: bishops, priests, religious, and lay faithful unto the end, who have offered their lives so that the Church can fulfill her own mission,” Francis told the bishops.

Last but not least, the pope thanked the Mexican bishops for what they’re doing to confront what he called the “challenge of our age:” Migration.

Francis asked them to strengthen the communion “with your brothers of the North American episcopate, so that the maternal presence of the Church can keep alive the roots of the faith of these men and women, as well as the motivation for their hope and the power of their charity.”

When he celebrates Mass in Ciudad Juarez on Wednesday, just 90 yards from the border, Francis will be accompanied by several US bishops, including Boston Cardinal Sean P. O’Malley.

Many other American prelates will be joining the celebration from El Paso, Texas, making a strong statement amid a 2016 US presidential campaign that has seen some Republican candidates promising to build a wall along the 2,000-miles border dividing the two nations.

“Your efforts will not be in vain when your dioceses show care by pouring balm on the injured feet of those who walk through your territories, sharing with them the resources collected through the sacrifices of many,” Francis told the Mexican bishops.

Material from the Associated Press was used in this report.