The pontiff used the service in Ecatepec, a rough Mexico City suburb, to touch on two major themes of his trip to Mexico -- drug violence and the plight of migrants.
The pope urged his flock to turn Mexico into a "land of opportunity," where "there will be no need to emigrate in order to dream" and where they will "not have to mourn men and women, young people and children who are destroyed at the hands of the merchants of death."
Ecatepec, a city of 1.6 million people, has become infamous for a spate of disappearances of women, whose bodies have turned up in abandoned lots or canals, prompting authorities to declare a "gender violence alert" last year.
The city lies in the populous state of Mexico, where some 600 women have been killed between January 2014 and September 2015, according to the non-governmental National Citizen Observatory of Femicides. Francis urged the faithful to resist the three temptations of Christ -- vanity, pride and wealth.
"Brothers and sisters, let's get this into our heads: You can't talk with the devil. You can't talk with him because he will always defeat us," the 79-year-old emphasized.
Throngs lined the streets of Ecatepec, where walls were decorated with graffiti art featuring the pope's image, to cheer the popemobile on the second full day of a trip that will take him to other Mexican hotspots. Hundreds of police officers stood guard around the field.
"What the pope said was important. (Violence) is a delicate issue because the authorities aren't doing anything to end this," said Alicia Tejeda, a 27-year-old accountant who watched mass on a large screen installed near the field.
Patricia Flores Marin, 46, was touched by the message about migrants because her daughter illegally migrated to the United States, but she is glad her child no longer lives in Ecatepec.
"I wouldn't be at ease having her here.There are too many kidnappings," she said. The Argentine-born pontiff made it clear before his arrival in Mexico that he would speak out about the corruption and crime afflicting parts of the country.
Two massacres served as reminders of Mexico's ills during his visit: 49 inmates died in a prison riot in the northern city of Monterrey on the eve of his arrival, while 13 people were shot dead in the drug cartel-plagued Pacific state of Sinaloa on Saturday.
Francis used his visit to the National Palace and the capital's cathedral on Saturday to bluntly urge political and religious leaders to provide Mexicans with "true justice" and combat drug violence with "prophetic courage."