ECATEPEC, Mexico — Pope Francis stepped into the heartland of Mexican inequality on Sunday, presiding over an enormous outdoor Mass in the impoverished outskirts of the capital and urging the joyous crowd not to fall prey to the wealth, vanity and pride that can create “a society of the few, and for the few.”

By coming to Ecatepec, one of the country’s largest, poorest and most violent cities, the Latin American pope placed himself at the center of Mexico’s identity crisis. Nagging economic disparity has left nearly half of the country living in poverty while a mere sliver of society controls the rest — even as drug traffickers terrorize large parts of the nation.

Standing on a gigantic stage before several hundred thousand people, Francis told his listeners that the Lenten season, which began last week, is one of conversion, and that Mexico needed conversion. He asked Mexicans to turn their nation into “a land of opportunities, where there will be no need to emigrate in order to dream, no need to be exploited in order to work, no need to make the despair and poverty of many the opportunism of a few, a land that will not have to mourn men and women, young people and children who are destroyed at the hands of the dealers of death.”

Francis arrived in Mexico on Friday night, and on Saturday met President Enrique Peña Nieto at the National Palace in Mexico City before addressing Mexico’s bishops. His trip to Ecatepec was barely 20 miles away, yet it delivered Francis to a different world, one emblematic of what he often calls “the peripheries,” the neglected places at the edges of wealth or political power.