BRZEGI, Poland — Pope Francis celebrated the last Mass of his trip to Poland on Sunday before one million pilgrims near Krakow as he discussed, once again, the terrorist threat and migrant crisis. The pope urged young people during the weekend to stand up to violence, hatred and terror instead of being “couch potatoes” glued to “the screen of a cellphone.”

Reinforcing remarks he made many times during his five-day stay in Poland about those who suffer — the sick, people with disabilities, the elderly and, especially, refugees — the pope expressed concern that young people “confuse happiness with a sofa” as they become indifferent to the increasingly dark events of the world.

Francis, 79, said last week that the killing of an 85-year-old priest in France, among other terrorist attacks, was proof that the “world is at war,” though one that was not caused by religion.

“Today’s world demands that you be a protagonist of history, because life is always beautiful when we choose to live it fully, when we choose to leave a mark,” he said Sunday as he addressed pilgrims on a vast field in Brzegi, a village about seven miles east of Krakow, for World Youth Day.