Pope Francis arrived in Uganda on Friday on the second leg of his Africa pilgrimage, declaring Africa the "continent of hope" and honouring Uganda's most famous Christians.

Francis arrived at Entebbe International Airport, where Ugandan President Yoweri Museveni, flanked by a military brass band and traditional drummers and dancers welcomed him.

Francis, who arrived from Kenya and is scheduled to visit Central African Republic, is in Uganda mainly to honour the memory of a group of Ugandan Christians who were killed in the late 19th century on the orders of a local king eager to thwart the growing influence of Christianity.

Those victims, known as the Uganda Martyrs, include 45 Anglicans and Catholics killed between 1885 and 1887. Pope Paul VI canonized the 22 Ugandan Catholics in 1964.

"They remind us of the importance that faith, moral rectitude and commitment to the common good have played, and continue to play, in the cultural, economic and political life of this country," Francis told Museveni and other Ugandan authorities and diplomats at a welcome ceremony at the state house.

Pope Francis waves to faithful as he leaves after a meeting with the Kenyan youth at the Kasarani stadium in Nairobi on Thursday. (Thomas Mukoya/Reuters)

In an unusual break with papal trip protocol, Museveni didn't offer welcoming remarks.

Later Friday, Francis arrived at a shrine honouring the martyrs in Munyonyo, where they were condemned to death.

Francis arrived in Kampala after a busy final day in Kenya that was highlighted by his visit to one of the capital's 11 slums and a spontaneous, off-the-cuff monologue to thousands of Kenyan youths about preventing young people from falling prey to corruption and radicalization to go fight with extremist groups.

In the Kangemi shanty, Francis denounced conditions slum-dwellers are forced to live in, saying access to safe water is a basic human right and that everyone should have dignified, adequate housing, access to sanitation, schools and hospitals.

"To deny a family water, under any bureaucratic pretext whatsoever, is a great injustice, especially when one profits from this need," he said.

Residents lined the mud streets to welcome Francis, standing alongside goats and hens outside the corrugated tin-roofed shacks where many of the shantytown's small businesses operate: beauty parlours, cellphone "top-up" shops and storefront evangelical churches.

Those lucky enough to score a spot at St. Joseph's parish erupted in cheers and hymns when Francis arrived, ululating and waving paper flags printed with his photo and the "Kariba Kenya" welcome that has been ubiquitous on the pope's first-ever visit to Africa.

These are wounds inflicted by minorities who cling to power and wealth. - Pope Francis

Francis, known as the "slum pope" for his ministry in Buenos Aires' shantytowns, has frequently insisted on the need for the three "Ls" — land, labour and lodging. On Friday he focused on lodging as a critical issue facing the world amid rapid urbanization that is helping to upset Earth's delicate ecological balance.

Kangemi is one of 11 slums dotting Nairobi, East Africa's largest city, and is home to about 50,000 people. The UN Habitat program says some 60 per cent of Nairobi's population lives on just 6 per cent of the city's residential land in these unofficial settlements lacking basic sanitation or regular running water.

Francis denounced the practice of private corporations grabbing land illegally, depriving schools of their playgrounds and forcing the poor into ever more tightly packed slums, where violence and addiction are rampant.

In January, police used tear gas on schoolchildren demonstrating against the removal of their school's playground, which has been allegedly grabbed by powerful people. After an outcry, the Kenyan government declared the playground the property of the school.

"These are wounds inflicted by minorities who cling to power and wealth, who selfishly squander while a growing majority is forced to flee to abandoned, filthy and run-down peripheries," Francis said.

Pope Francis speaks at the United Nations regional office in Nairobi, Kenya, Thursday. He warned it would be 'catastrophic' if interest groups block a global agreement to curb fossil fuel emissions. (Sayyid Azim/Associated Press)

He called for a "respectful urban integration" with concrete initiatives to provide good quality housing for all.

His message was welcomed by residents of Kangemi, who said the city only pipes in water three days a week, Tuesday through Thursday, but it's not safe to drink. Garbage collection goes to only those who can pay for it.

"Some people don't have toilets in their homes," said Emily Night, a mother of two who works at the St. Joseph's HIV counselling program. "Those that do, maybe 50 people are using it!"

Francis raised the issue of environmental deterioration in cities in his landmark encyclical "Praise Be," saying many megacities today have simply become health threats, "not only because of pollution caused by toxic emissions but also as a result of urban chaos, poor transportation, and visual pollution and noise."

After the visit to Kangemi, Francis received a rock-star welcome at Kasarani stadium, where he zoomed around the track in his open-sided popemobile to the delight of thousands of young Kenyans in the crowd. The stadium was so packed with the faithful that many more stood outside, unable to enter.

How to avoid radicalization

As he tends to do when surrounded by young people, Francis ditched his prepared speech and spoke off-the-cuff at length about problems Kenyan young people are facing, including the temptation to go the way of Kenya's many corrupt officials and institutions or to go off and join an extremist group.

Francis told the crowd that the way to prevent the young from being radicalized is to give them an education and a job.

"If a young person has no work, what kind of a future does he or she have? That's where the idea of being recruited comes from," he said.

Kenyans make up the largest contingent of foreign fighters in the Somali based al-Qaeda-linked extremist group al-Shabab, which has staged attacks in Kenya.

Francis also urged the kids to resist the temptation of corruption, saying it's like sugar: You develop a taste for it but it's ultimately terrible for you.

On Sunday, he is due to arrive in the Central African Republic.