Pope Francis decried inequality and corruption during his first full day in Mexico, where he was greeted Saturday by top government officials and wildly cheering throngs of spectators.
Inequality creates "fertile soil for corruption" and drug trafficking, he said.
Mexico has suffered an estimated 100,000 deaths in the last decade in a drug war that has pitted trafficking cartels against each other and security forces.
Francis was officially welcomed by President Enrique Pena Nieto at the presidential palace in Mexico City with the full cabinet.
"Mexico loves you," Pena Nieto said.
In a meeting with the country's more than 170 bishops, Francis, a member of the Jesuit order, said the church in Mexico must become more socially engaged.
"If you have to fight, then fight," he said, exhorting them to be ambassadors of God rather than princes.
Francis urged priests to stand with "prophetic courage" against the cartels and not to underestimate the challenge to Mexican society and the country's youth from the drug trade.
Later, in his first mass since arriving in Mexico, the pope offered comfort for the country's "mothers, fathers and grandparents" who have lost children in the violence.
"The tears of the suffering are not in vain," Francis said in the Basilica of Our Lady of Guadalupe in northern Mexico City.
Before landing late Friday in Mexico City, Francis had stopped in Havana for a more than two-hour meeting with the head of the Russian Orthodox Church, Patriarch Kirill. They discussed religious and political affairs during a historic meeting to overcome the millennium-old rift between the Roman Catholic and Eastern Orthodox churches.
On his first visit as pope to predominantly Catholic Mexico, the former Argentine cardinal was greeted at the Mexico City airport by a mariachi band, as well as Pena Nieto and his wife, Angelica Rivera.
Children in traditional costumes presented Francis with a casket containing soil from 32 Mexican states, which he blessed.
He blessed a children's choir and briefly donned a broad-brimmed black mariachi hat.
Crowds along the airport road chanted "Francis, brother, you are Mexican" as he passed in his open popemobile under heavy police guard.
His tour through Wednesday includes six cities in four states.