RIO DE JANEIRO — In a rare moment shielded from the world’s eyes, Pope Francis on Friday privately counseled young prisoners from several Rio de Janeiro jails, who in turn used the visit to draw attention to one of the most notorious massacres involving authorities in recent Brazilian history.

For the new pope, it was a profoundly personal act in his very public weeklong pilgrimage to the world’s largest Roman Catholic country. For the eight prisoners, all minors, it was an eager moment to draw attention to human rights abuses, especially those that target the poor.

The celebrations here marking World Youth Day are being attended by hundreds of thousands of faithful, and later Friday included the symbolic reenactment of the crucifixion of Christ on the glistening white sands of Copacabana beach.

For that event, scene and scenario seemed incongruous. Down the beach from where the Stations of the Cross would be walked, men and women in skimpy bathing suits were spiking volleyballs, walking dogs, skateboarding and sipping juice from green coconuts.

But pilgrims said they were not bothered.

“The pope wants Catholics to be happy. He’s happy and this is a happy place,” said Ana Karina Fuentes, a 24-year-old medical student hoisting a gigantic flag from her native Chile.

“It’s most important what you have inside, not the place,” said Lucia Haulet, 26, of Santa Fe, Argentina. “It’s what’s in your heart, not the landscape.”

Earlier, inside the imposing St. Joachim palace, which houses the archdiocese of Rio, the pope prayed with the eight young inmates, two of them girls.

“The pope had strong words of encouragement for each one,” his spokesman, Rev. Federico Lombardi, said later. One of the girls sang him a song, and they presented him with a rosary that was inscribed with the words, “No more Candelaria, no more violence.”

Twenty years ago this month, a group of gunmen that included police opened fire on homeless children who had sought shelter in the Candelaria Roman Catholic Church in Rio. Eight children were killed.

The session completed the Pope’s effort to address a triumvirate of key themes, Lombardi said: suffering, poverty and youth in distress.

On Wednesday, Francis prayed with the suffering, young men and women in the throes of drug addiction and recovery. On Thursday, he visited the poorest of the poor, venturing into a favela, or slum, to decry corruption and urge officials to do more to help their people.

The prisoners represented youth in distress. Lombardi also revealed that the former Cardinal Jorge Maria Bergoglio of Argentina, since becoming pope in March, has continued to telephone a group of inmates in a Buenos Aires detention center every two weeks. “He is their shepherd … their friend,” Lombardi said.

The Vatican did not say what crimes the prisoners who met with the pope were charged with or convicted of, although there was a hint some might soon receive a pardon.

There has been a movement in some Brazilian government circles, opposed by human rights groups, to lower the age at which suspects can be tried as adults. Brazil’s prisons, as in much of Latin America, are notoriously overcrowded, prone to deadly riots and rife with disease, including HIV.

Francis started Friday by celebrating Mass with his fellow Jesuits and then hearing the confessions -- in Portuguese, Spanish and Italian -- of five people chosen by raffle.

“The words of the Holy Father, with their simplicity and sincerity, help us to interpret God's plan for each of us,” one of the five, 27-year-old Claudia Giampietro of Italy, told the Italian news agency Ansa.

Afterward, the pope lunched with 12 young people from around the world, including Sri Lanka and Russia, not one of the more Catholic countries on the planet.

“There is a joke in Russia: It is easier to take all the Catholics in Russia to the pope, than for the pope to go to Russia,” said Polina Grigorieva, one of the pope’s lunch partners.

The pope has been delivering clear, direct messages, a contrast to his more erudite and sometimes esoteric predecessor Pope Benedict XVI. In one of his most feisty messages, Francis went off script and chatted with pilgrims from his native Argentina, telling them it was time to give the church status quo a run for its money.