The Pope has urged young people to stay away from the "spiritual desert" he says is spreading across the world, at the end of his trip to Australia.
Pope Benedict XVI told a crowd of hundreds of thousands of people at the Catholic Church's World Youth Day event at Sydney's Royal Randwick Racecourse that they should build a new age free from greed.
The world "needs renewal", he said, and challenged the young pilgrims to be agents of change.
It was the 81-year-old pontiff's first trip to Australia and he flies back to Rome on Monday after a landmark visit that included a papal apology to victims of church sexual abuse.
Declaring the spirit of the church alive and well, the Pope told pilgrims from more than 170 countries he had shared an "unforgettable experience" in Australia.
He said: "Our eyes have been opened to see the world around us as it truly is, 'charged' as the poet says, 'with the grandeur of God', filled with the glory of His creative love."
The Pope said a new generation of Christians was being called to help build a world in which God's gift of life was welcomed and love was not greedy or self-seeking but pure, faithful and genuinely free.
He spoke of a "new age in which hope liberates us from the shallowness, apathy and self-absorption which deaden our souls and poison our relationships".
The Pope announced that the next World Youth Day in 2011 would be held in Madrid.
The pontiff spoke from a sanctuary 25m off the ground and painted deep red to reflect the Australian outback and the flames of the holy spirit.
His audience included 26 cardinals and 420 bishops at a grand mass featuring a 300-strong choir and an 80-piece orchestra.
The Pope had a bird's eye view of the faithful when he flew over Randwick in a helicopter on Sunday morning before doing a lap of the racecourse in his Popemobile.
At the mass he officiated over the sacrament of confirmation for 24 adults, including two from each Australian state.
Most pilgrims at the mass, an estimated 235,000, had camped out under the stars on Saturday night after making a nine kilometre pilgrimage across the Sydney Harbour Bridge and through city streets.
The pilgrimage was one of a number of World Youth Day events that brought Sydney to a standstill, including the spectacular Stations of the Cross re-enactment of Christ's final days and the Pope's official arrival via a Sydney Harbour "boat-a-cade".