Pope Benedict celebrates World Youth Day closing Mass
Pope Benedict XVI has celebrated the closing Mass of the World Youth Day festival in Spain in front of thousands of young Catholics.
He urged pilgrims to "share the joy of their faith" and announced that the next event would be held in Rio de Janeiro in 2013.
On Saturday, the Pope had delivered a homily to a million-strong crowd.
But his speech there was cut short by a violent thunderstorm which blew off his skullcap.
Addressing the crowds on Sunday, he urged them all too take what they had learned there back to their own communities.
"Do not keep Christ to yourselves. Share with others the joy of your faith," he said.
There were huge cheers as he named Rio as the next host.
"I am very happy because our youth in Brazil will be able to experience what I am experiencing here and to see the Holy Father," said Brazilian pilgrim Maria da Gracia.
World Youth Day has drawn hundreds of thousands of pilgrims to Madrid from all over the world.
Many had camped at the Cuatro Vientos air base overnight, having waiting for hours in the open air the previous day for the prayer vigil.
Madrid is in the middle of a heatwave and even though fire engines doused the crowds with water, hundreds of fainting pilgrims were treated by medics.
But the Pope's arrival at the site Saturday coincided with a massive downpour and forced him to stop in the middle of a welcome address.
Sheltering under an umbrella, the 84-year-old commended the crowd for having faith "stronger than the rain".
The storm also destroyed some of the tents in which pilgrims were to have taken Holy Communion, meaning some had to go without on Sunday.
There have been several protests against the cost of the Pope's four-day visit, which comes at a time of high unemployment and spending cuts.
The event's organisers say most costs will be met by the pilgrims themselves.
Protests have also been staged by gay men and lesbians against his visit and the Catholic Church's opposition to same-sex marriages.
The pontiff's four-day visit began on Thursday and his engagements have included celebrating Mass with thousands of future priests, meeting young nuns and taking part in a Way of the Cross procession.
He has also met King Juan Carlos I and Queen Sofia, and Spanish Prime Minister Jose Luis Zapatero.