Pope Francis closed his weeklong visit and World Youth Day events by appealing, particularly to Latin Americans, to return to their home countries and “go and make disciples” in a Sunday Mass attended by three million on the Copacabana beach.

“In a special way, I wanted this command of Christ — ‘Go’ — to resonate with you, the young people of the church in Latin America,” Francis said in a largely solemn homily in which he occasionally raised his voice and hands, with attendees so silent that his words could be heard among the entire crowd. “This continent received the word of the Gospel, which made a mark on its path and produced much fruit. Now you all are trusted with this word, so that it can resonate with a renewed force.”

The pope also revealed the next World Youth Day location: Krakow, Poland in 2016, which led to cheers of “On to Krakow!” across the beach.

Unlimited Digital Access: Only $0.99 For Your First Month

The Argentine — the first pope from Latin America, elected four months ago — was received like a rock star throughout the week’s events, strengthening his reputation among followers as a pope who makes an effort to connect with common people and emphasize social justice. Sunday’s Mass rivaled the city’s Carnival and New Year’s Eve celebrations in the number of attendees, which also included Presidents Dilma Rousseff of Brazil, Evo Morales of Bolivia, and Cristina Fernández of Argentina.

The pope’s emphasis on Latin America reflects the region’s centrality to the faith: 42 percent of Catholics live there. Brazil has the largest number of Catholics of any country. But that number is declining, from 92 percent of the country in 1970 to 65 percent now.

“I think he came out with a very positive image, with his congeniality, and the simple way he speaks, affectionate and smiling,” said Cecília Loreto Mariz, a sociologist who studies Catholicism and Pentecostalism at the State University of Rio de Janeiro. Mariz added that Francis’ avoidance of hot-button issues like same-sex marriage and abortion and his focus on social justice and marginalized populations reflected his Franciscan roots. She also noted that in his speeches, he did not often use the phrase “Catholic church” and instead spoke broadly about faith.

The week in Rio was Francis’ first foreign trip and gave Vatican watchers a glimpse into his political direction. Francis visited with juvenile detainees and walked through a crowded slum on a rainy morning, where he spoke about corruption and gave a nod to the demonstrations that have brought millions of Brazilians to the streets since June and taken a great toll on elected officials’ approval ratings.

Still, he frustrated even his supporters with comments he made Wednesday at a hospital that treats drug addicts.

“It is not by freeing up the use of drugs, as is being discussed in several parts of Latin America, that you are able to reduce the propagation and influence of addiction,” he said.

Maria Lúcia Karam, a retired judge and member of the Brazilian branch of Law Enforcement Against Prohibition, expressed admiration for Pope Francis and said she expected him to change his position on drug legalization over time. “I am certain that this pope, who is very sensitive, who is marvelous ... I think sooner or later he will understand the suffering caused by prohibition is greater than the suffering of legalization,” she said.

Karam said that Francis had shown particular sensitivity to racial minorities and the poor, remembering his recent Mass on the Italian island of Lampedusa for African migrants who died trying to make it to Europe. “This is something that the pope will understand, since he is so sensitive to the necessity of rescuing the poorest,” she said, adding that Francis will understand the “racist” implications of the drug war.

Others criticized the organization of the weeklong events, which included an accidental metro outage, a heavy-handed police response to demonstrators who protested in front of the governor’s palace on the first day of the papal visit, and a change of location for the final Mass from working-class Guaratiba on the edges of Rio to the Copacabana beach. The change was motivated by the week’s heavy rains that had made Guaratiba hazardous for crowds.

Thousands of pilgrims slept on cardboard and in makeshift tents along the beach and in front of gated beachside condominiums in Copacabana on Saturday night to participate in a night-time vigil before the morning Mass.

“We are not very content because it was disorganized,” Mónica Barahoua, 28, from Colombia, said as she awoke surrounded by food crumbs and other pilgrims covering their noses due to the smell of nearby toilets. She said the residences that she and her fellow travelers were assigned to were close to Guaratiba but well over an hour from Copacabana, making transportation difficult.

But Claudia Brandao, 30, a mother who traveled with her nine-month-old daughter from Angola, had only praise for the event.

“People welcomed me that had never seen me or met me before,” said an emotional Brandao after the Sunday Mass.

She added that Francis’ style has already had an impact on fellow believers. “I see people happier and more charismatic,” she said.