Pope Francis has encouraged people to never lose their hope in God despite the challenges they may be facing in life.
The Pope was preaching at his first public Mass on the American continent, held at the Shrine of Our Lady of Aparecida, patron of Brazil.
As great as the challenges of life can seem, he said God "never allows us to be overwhelmed by them".
"In the face of those moments of discouragement we experience in life, in our efforts to evangelise or to embody our faith as parents within the family, I would like to say forcefully: Always know in your heart that God is by your side; he never abandons you.
"Let us never lose hope. Let us never allow it to die in our hearts. The 'dragon', evil, is present in our history, but it does not have the upper hand. The one with the upper hand is God, and God is our hope."
The Pope is in Brazil as part of a weeklong visit to participate in World Youth Day. Around 1.5 million young Catholics from around the world are expected to take part in the festival.
He appealed to young people especially not to be lured by things that cannot offer real hope or satisfaction.
"It is true that nowadays, to some extent, everyone, including our young people, feels attracted by the many idols which take the place of God and appear to offer hope: money, success, power, pleasure. Often a growing sense of loneliness and emptiness in the hearts of many people leads them to seek satisfaction in these ephemeral idols," he said.
At the same time, he spoke of the need to maintain a "positive outlook" , saying Christians who knew the love of God "cannot be pessimists".
Addressing older people, he called upon them to work together with the younger generations in building a better world.
"Young people are a powerful engine for the Church and for society. They do not need material things alone. Also and above all, they need to have held up to them those non-material values which are the spiritual heart of a people, the memory of a people."
He encouraged people to have an openness to being surprised by God, saying that even in the midst of difficulties "God acts".
"God always surprises us, like the new wine in the Gospel we have just heard. God always saves the best for us. But he asks us to let ourselves be surprised by his love, to accept his surprises. Let us trust God. Cut off from him, the wine of joy, the wine of hope, runs out," he said.