Homemade bomb found at Pope Francis' visit site
A riot police officer detains a demonstrator during clashes near Guanabara Palace where Pope Francis met with President Dilma Rousseff in Rio de Janeiro - Reuters Reuters

A homemade bomb has been found near a popular Brazilian shrine ahead of Pope Francis's visit.

The explosive was discovered in a lavatory inside the National Sanctuary of Aparecida, which is located between Rio de Janerio and Sao Paolo.

Francis, 76, is scheduled to visit the place later in the week as part of his Brazilian trip.

"It was a homemade device with little potential to cause fatalities. Such episodes formed part of our security forces' training in Aparecida and at no point were civilians' lives in danger," the Brazilian military said a statement.

The device could be compared to dynamite with a fuse and was discovered during a routine security check, said officials.

The bomb, made with a plastic pipe wrapped in tape, was detonated without any incident. It is still uncertain whether the bomb was related to the pontiff's visit.

However, the police said the lavatory is located in an area unlikely to be used during the papal visit.

The Shrine of Our Lady of Aparecida is one of Brazil's most revered Catholic sites.

Security has been beefed up for Francis's visit and nearly 22,000 security forces have been deployed in Rio.

The Latin American country is spending about $52m (£33.8m) on security and logistics.

Spiralling protests against the visit and increasing crime rates across the country have underscored the huge challenge faced by the security staff.

Francis is to preside over the Roman Catholic World Youth Day festival which is expected to attract tens of thousands of young pilgrims.