By motorcade and popemobile and simple shoe leather, in a daylong tour up and down Manhattan that found pockets of joy and pain, wealth and want, Pope Francis on Friday called for social justice and peace in addresses to world leaders and workaday New Yorkers alike. He ended with a stirring homily that was both an ode to the city and a reminder to watch for glimpses of the presence of God among the poorest of the poor.

“In big cities, beneath the roar of traffic, beneath the rapid pace of change, so many faces pass by unnoticed because they have no ‘right’ to be there, no right to be part of the city,” Francis said in a Mass before 20,000 at Madison Square Garden. “They are the foreigners, the children who go without schooling, those deprived of medical insurance, the homeless, the forgotten elderly. These people stand at the edges of our great avenues, in our streets, in deafening anonymity.”

That theme, that “God is living in our cities,” provided an apt conclusion to a day spent navigating New York’s complicated fabric of rich and struggling. It was the pope’s first visit to the city, where the longtime hum of the machines of commerce and prosperity has brought the very excesses he has spent his papacy pushing against. It was impossible to ignore, behind the rows and rows of well-wishers who packed Central Park’s broad meadow, the soaring columns of skyscrapers with penthouses that are home to many of the world’s wealthiest people.