Madrid (CNN) -- Catholic youths should not hide their beliefs from their peers, Pope Benedict XVI told them in a World Youth Day speech delivered Thursday in Spain.

"With all my heart, I say again to you young people: Let nothing and no one take away your peace; do not be ashamed of the Lord," the pope said.

"The young followers of Jesus must be aided to remain firm in the faith and to embrace the beautiful adventure of proclaiming it and witnessing to it openly with their lives," he added.

His four-day visit to Spain coincides with a weeklong series of religious events that the Roman Catholic Church organizes every three years.

The pope was greeted by a large crowd of followers, youths from all over the world, but his visit was not without controversy. With Spain suffering a deep economic crisis and nearly 21% unemployment, the amount that the pope's visit is costing the country has been top news in recent days.

The pope arrived in Madrid as protests took place in the city over that cost. The economic crisis has previously sparked protests in the country. Back in May, Spaniards demonstrated for days before an election. Unlike previous protests that were organized by trade unions, those protests appeared to be grass-roots movements fueled by social networks.

"I have come here to meet thousands of young people from all over the world, Catholics committed to Christ searching for the truth that will give real meaning to their existence," the pope said in his speech.

"Many of them have heard the voice of God, perhaps only as a little whisper, which has led them to search for him more diligently and to share with others the experience of the force which he has in their lives," he added.

One man was arrested Tuesday on suspicion of planning an attack against those protesting the pope's visit, police said.

The suspect, identified as Jose Perez Bautista, was a volunteer from Mexico for the papal visit's organizing committee.

Perez, who is studying chemistry, was accused of plotting to use noxious gasses and other chemicals against the protesters. He was released Thursday on provisional liberty. He was required to surrender his passport, must remain in Spain, and must report twice daily to a police station, said Bernardo Graue of the Mexican Embassy in Madrid.

The judge may at some point in the future charge Perez with making a threat against a social collective or a group, which is a lesser charge than he could have gotten, based on the allegations.

Perez, who was making headlines in his home country, was in good spirits, Graue said.

CNN's Al Goodman contributed to this report.