He stepped out of his car on a muddy street and walked slowly past hundreds of poor children who live in shanties. He heard stories of gangs preying on women, of people dying from homemade alcohol and of sinister plots by businessmen to flood children out of their schools and steal land.

When it came time to speak, Pope Francis delivered his sharpest remarks yet on his first trip to Africa.

He lashed out against what he called “new forms of colonialism, which would make African countries parts of a machine, cogs on a gigantic wheel.”

Francis said that “countries are frequently pressured to adopt policies typical of the culture of waste, like those aimed at lowering the birthrate.”

He called the slums “wounds” inflicted by the elite. “How can I not denounce the injustices which you suffer?” he said.

Video

Speaking in Nairobi during his first visit to Africa, Pope Francis called for more equitable social integration and for helping the county’s poor.

There are few places more apt for Francis, who has cast himself as a champion of the world’s poor, to deliver such remarks. The slum he visited, Kangemi, on the outskirts of Kenya’s capital, Nairobi, is a seemingly endless rusted-roof settlement where thousands of families cram into iron shacks with ripped mattresses on the floor and cockroaches scuttling in the unlit corners. Many here survive on a few dollars a day.

Before he spoke, the pope watched a two-minute video that showed images of children wading waist-deep through rivers of garbage. Many of Nairobi’s slums have no sewers, giving rise to what Kenyans call the “flying toilet,” a practice of people relieving themselves in a plastic bag, closing it with a knot and then hurling it as far as possible.

Francis did not share any new solutions to poverty, but he did say, “We need integrated cities which belong to everyone.”

And he singled out “faceless private developers” who try to steal children’s playgrounds, a clear reference to an episode this year when the Kenyan police shot tear gas at children trying to protect a grassy field from being taken over by a cartel of mysterious real estate developers.

Everywhere he has gone so far, Francis has been swallowed by enormous, ecstatic crowds. The Roman Catholic Church is growing rapidly in Africa, partly because of its role in delivering crucial services, such as good schools and hospitals, that many African governments fail to provide. For the past two days, Nairobi’s streets have been jammed by people who have waited behind police barricades for hours for just a glimpse of the passing pope. On Thursday, 400,000 turned out for a rain-soaked Mass.

Image

Pope Francis visited the Kangemi slum on the outskirts of Kenya’s capital, Nairobi, on Friday.CreditGoran Tomasevic/Reuters

After visiting the slum, Francis traveled to a stadium in Nairobi brimming with thousands of young people. As he pulled in, a deafening roar went up. People were dancing in the stands to choir music, wildly shaking yellow Vatican flags and cheering: “Papa Francis! Papa Francis!”

The pope asked everyone to stand up and hold hands as a gesture against ethnic divisions, one of Kenya’s most vexing problems. In 2007 and 2008, more than a thousand people were killed in ethnic clashes after a disputed election, and ethnic rivalries continue to be the axis that Kenya’s dysfunctional politics revolve around.

According to opinion polls, those divisions and corruption were among the topics Kenyans most wanted Francis to address. And before he left the stadium, the pope shared a few words on corruption, though he did not point any fingers.

The subject has been a bit awkward for him because the corruption plaguing Kenya has been carried out, according to numerous allegations, by members of the same government that has placed the red carpet under his feet.

Francis in Nairobi on Friday. Later in the day, he flew to Uganda.CreditL’Osservatore Romano

“Please,” he implored. “Don’t develop that taste.”

Later on Friday, Francis flew to Uganda, where he will visit a shrine honoring some of the country’s first Christians who were burned alive. So far on his African trip, he has called for more attention to be paid to the poor and for serious dialogue between different religions.

His last stop, on Sunday, will be the Central African Republic, a country torn by a brutal civil war between Christians and Muslims. Many analysts say that the Central African Republic is one of the most dangerous places a modern pope will have ever visited.

Morning rain gave way to a light late-afternoon breeze as Francis stepped off the plane in Uganda to ululating, hymns, a marching band, a 21-gun salute, dancers and a red carpet lined by clergy.

After touching down, Francis spent roughly 20 minutes shaking hands alongside Uganda’s president, Yoweri Museveni, before being whisked to the State House in a modest black hatchback for an official greeting.

Uganda’s highway all the way from the airport into the capital Kampala was lined with children waving Ugandan and Vatican flags; traditional performers resplendent in white dress; palm trees adorned with ribbons; students sitting cross-legged by the roadside, from all faiths; even bright caricature paintings of Francis in front of a Ugandan flag — all to see who the main news pundits here call “a different pope.”

“The Papa!” said Fazil Kabugo, a butcher in Kampala, readying to trek down to a Christian shrine at Munyonyo by Lake Victoria, where Francis was scheduled to visit Friday evening.

“O.K., I’m a Muslim,” he added, “but he’s a very good man.”

Josh Kron contributed reporting from Kampala, Uganda.

A version of this article appears in print on , Section A, Page 4 of the New York edition with the headline: In Nairobi, the Pope Denounces ‘New Forms of Colonialism’. Order Reprints | Today’s Paper | Subscribe