Tens of thousands of people have turned out on Rio de Janeiro's streets to greet Pope Francis, joyfully swarming his car and chanting his name in a country recently rocked by widespread social unrest.
The 76-year-old Argentine, making his first trip abroad since becoming the first Latin American pontiff, was surrounded by throngs of cheering faithful as he was driven through the Brazilian city on Monday.
The first day of his visit was, however, marred by violence when riot police used tear gas and water cannon to disperse hundreds of people protesting against the cost of his visit after he met President Dilma Rousseff at the state governor's palace.
Authorities said that rioters threw firebombs at riot police near the local government headquarters.
AFP news agency said that its photographer Yasuyoshi Chiba, 42, from Japan, who was capturing the confrontation, was clubbed on the head by a riot policeman and had received three stitches from doctors treating him over the injury in hospital.
Earlier police blocked access to the palace as hundreds of Anonymous "hacktivists" and gay campaigners rallied to denounce Rio state Governor Sergio Cabral's policies as well as the $53 million spent on the pope's landmark visit to what remains the world's most populous Catholic nation.
Moments earlier at the nearby palace, the pope had urged young Roman Catholics to "go and make disciples of all nations".
Rousseff's popularity has plunged in recent weeks, amid frustrations with corruption and the pace of economic growth. The leftist and Brazil's first female president acknowledged the social discontent, saying Brazil's youth was fighting for "a new society".
After massive protests over lagging public services and corruption regularly spiraled into violence in recent weeks, authorities wanted to ensure an incident-free visit for the pontiff.
Explosive device discovered
Despite the heavy security, with 30,000 soldiers and police mobilised, several people were able to stop the pope's car convoy and touch him through his open window. The pope shook hands and kissed babies.
The army, meanwhile, said soldiers discovered an explosive device during a training session on Sunday in a bathroom at the Shrine of Our Lady of Aparecida in Sao Paulo state, which the pope will visit on Wednesday.
The homemade device was destroyed and authorities said it was nowhere near the area where the pope or pilgrims will congregate.
Pope Francis came to Brazil, which has the world's largest Roman Catholic population, to promote his vision of a more humble church and to attend World Youth Day, a week-long event drawing more than one million young Roman Catholics.
Excitement about his first overseas visit brought huge crowds into the streets, chanting "long live the pope," singing and waving the flags of Argentina and other countries.
The pope, first in a small four-door car and then an open-top jeep, waved at the faithful after deciding to leave his armored "Popemobile" behind, a decision that unnerved local authorities.
"I have learned that, to gain access to the Brazilian people, it is necessary to pass through its great heart; so let me knock gently at this door," Francis said at the governor's palace.
"I ask permission to come in and spend this week with you. I have neither silver nor gold, but I bring with me the most precious thing given to me: Jesus Christ," said the pope, who will lead an open-air sermon on Copacabana beach on Thursday.
Vatican spokesman Federico Lombardi said the pope was not worried about the massive crowd and that he wanted to avoid a "militarisation"of security, but he went to the governor's palace by helicopter to avoid the protest.