Pope Francis, speaking to an estimated 3 million people spread out over Copacabana beach, urged young people to become religious disciples to "the fringes of society", indispensable to a reinvigoration of the church.
Francis presided over the final Mass of nearly a week of activities as part of his first overseas trip as pope and the annual celebration of World Youth Day.
Among those attending the Mass were the presidents of Brazil, Argentina and Bolivia: Dilma Rousseff, Cristina Fernandez and Evo Morales, respectively.
As the Mass was winding down and worshippers took Communion, other pilgrims jumped into the sea for a brisk swim.
"Jesus is calling you to be a disciple with a mission," the pope said. "There are no borders, no limits: He sends us to everyone."
In his final homily, the Argentine-born pope urged the young to reach beyond their comfort zones to help rebuild a church that has suffered debilitating decline in Latin America, a region once dominated almost exclusively by Catholicism.
He allowed numerous elements into the Mass from the Catholic charismatic movement, a theologically conservative but theatrically boisterous strain that many see as the best answer to the down-to-earth evangelicals who have lured millions of worshipers away from the Catholic Church. Those elements included musical selections and the choice of certain charismatic priests to deliver greetings.