The Pope has declared his visit to Australia an "unforgettable experience", and also named the venue for the next World Youth Day.
He spoke during a mass in Sydney that was the largest event of World Youth Day celebrations there.
World Youth Day is generally hosted in Rome, but every second or third year, it is hosted by an international city.
The 81-year-old pontiff announced Madrid would be the 2011 venue at the conclusion of his Papal Mass at Randwick Racecourse in Sydney.
The mass was attended by hundreds of thousands of people, including 26 cardinals and 420 bishops.
The pope has officially brought the Catholic church's youth event in Australia to a close, ending six days of religious and celebratory events that has attracted pilgrims from more than 170 nations.
The Pope had a bird's eye view of the faithful when he flew over Royal Randwick Racecourse in a helicopter on Sunday before doing a lap of the racecourse in his Popemobile.
The mass has incorporated aspects of the Pacific region, with young men from Fiji - in traditional dress - escorting the holy gospel to the altar. His Holiness officiated over the sacrament of confirmation for 24 adults, two from each Australian state and the other 12 from around the world, during the mass.
"As we pray for the confirmands, let us ask that the power of the Holy Spirit will revive the grace of our own confirmation," the pontiff said.
"May he pour out his gifts in abundance on all present, on this city of Sydney, on this land of Australia and on all its people."
He said the events during World Youth Day had provided a wonderful, spiritual experience.
"Here in Australia, this `great south land of the Holy Spirit', all of us have had an unforgettable experience of the spirit's presence and power in the beauty of nature," the Pope said in his homily.
"We have seen the church for what she truly is: the body of Christ, a living community of love embracing people of every race, nation and tongue, of every time and place, in the unity born of our faith in the risen Lord."
The spiritual leader of the world's Catholics spent several hours with more than 235,000 pilgrims who camped out under the stars at Randwick after making 9km pilgrimage across the Sydney Harbour Bridge and through the city streets.
The pilgrimage was one of a number of World Youth Day events that brought Sydney to a standstill in the past week, including the spectacular Stations of the Cross and the Pope's official arrival via a Sydney Harbour boat-a-cade.
Apology to sex abuse victims
On Saturday, the Pope apologised to people sexually abused by members of the clergy in Australia.
He raised the issue during a ceremony to consecrate the altar of St Mary's Cathedral in Sydney.
"Here I would like to pause to acknowledge the shame which we have all felt as a result of the sexual abuse of minors by some clergy and religious in this country," the Pope said.