Speaking in his first mass in his native Latin America since being anointed the head of the Catholic Church, Pope Francis warned the faithful against 'ephemeral idols' such as money and power.
Some 200,000 pilgrims who braved rain and cold cheered when the pope arrived at the Shrine of Our Lady of Aparecida in Sao Paulo state and entered its grandiose basilica.
"What joy I feel as I come to the house of the mother of every Brazilian, the Shrine of Our Lady of Aparecida," he said in his homily after receiving and holding in his arms a black statue of the venerated Virgin Mary.
The 76-year-old pontiff, who arrived in Brazil on Monday for a weeklong Catholic youth event, is seeking to re-energize his young flock on his first overseas trip since becoming Latin America's first pope in March.
The region is home to 40 percent of the world's 1.2 billion Catholics but Brazil has seen its flock dwindle while Evangelicals gain ground.
In his homily, he urged pastors, parents and educators to "pass on to our young people the values that can help them build a nation and a world which are more just, united and fraternal."
"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," he said.
"Often a growing sense of loneliness and emptiness in the hearts of many people leads them to seek satisfaction in these ephemeral idols," the pope said in this pilgrimage town of 35,000 people.
"Always know in your heart that God is by your side; he never abandons you. Let us never lose hope," he went on as the mass was beamed on large screens to crowds outside.
The pope has a special connection to Aparecida. It was here in 2007 that the then cardinal Jorge Mario Bergoglio led a bishops' panel that drafted a document with a strong social and political appeal for the poor in Latin America.
An estimated 15,000 people packed the basilica for the mass while another 200,000 gathered outside, with 5,000 police and soldiers providing security. Last Sunday, authorities found an explosive in a parking lot bathroom but the Vatican said it was no cause for concern.
After the mass, the pope stepped out to bless the crowd and announced he would return in 2017, the 300th anniversary of the statue's discovery by three fishermen.
"Pray for me, I need it. God bless you. May the Lady of Aparecida take care of you," he said.
The pope had arrived from Rio by plane and helicopter and went through the crowd in an open-top jeep.
"Long live the pope, long live the pope," the crowd chanted.
Pilgrims had spent the night in the streets despite the foul weather, hoping for a glimpse of the Argentine pontiff.
"We want the pope to tell us there is hope for a better world," said 47-year-old Jose Antonio Rocha. "We also want Francis' example to bring renewal to the Church which sorely needs it."
Tereza Souza, 62, said it was very important for her to see him because "he is such a nice man, very simple, a saint."
The pope's visit to Aparecida followed a tumultuous start to his trip to Brazil.
His arrival on Monday saw crowds swarm his car and touch him. Later that night, police used tear gas to disperse hundreds of people protesting the $53 million spent on his visit.
Then Tuesday, Rio's subway broke down, causing chaos for throngs of pilgrims heading to a mass inaugurating the weeklong World Youth Day festivities.
Brazil's ability to handle this week is seen as a test of its capacity to host the football World Cup next year and the Olympic Games in 2016.
After mass, the pontiff will board his jeep to cover the more than two kilometers (1.2 mile) separating the shrine and the Bom Jesus seminary where he will rest and have lunch.
Last year, 10 million pilgrims visited Our Lady of Aparecida, which was proclaimed Brazil's patroness in 1930 and is celebrated on October 12. Francis will become the third pope to visit the shrine -- after John Paul II, in July 1980, and Benedict XVI, in May 2007.