Nairobi (AFP) - Pope Francis held his first open-air mass in Africa on Thursday with huge crowds hailing heavy rains as "God's blessing" as they sung and danced in the Kenyan capital.

Thousands of people queued through the night braving torrential downpours to take part in the historic mass, the first celebrated by Francis on African soil.

The 78-year-old pontiff received a tumultuous welcome as he arrived in an open-topped Popemobile, smiling and waving as worshippers cheered, ululated and raised their hands in the air.

At least 200,000 people crammed into the park at the University of Nairobi, Kenyan media said, in the pope's first major public appearance on a six-day trip which will also take him to Uganda and Central African Republic (CAR).

"It is beautiful," beamed a nun called Sister Rachel. "We all sat through the rain and were not worried."

"This is a very important moment in my life because I've never had the chance of attending a papal mass," said another pilgrim called Paul Ndivangu who arrived three hours before dawn after travelling 200 kilometres (120 miles) from the northern town of Nyeri.

But the numbers fell far short of the million people Catholic officials had expected to attend the service, with the weather likely keeping many away.

- A Swahili blessing -

In some places, so many people tried to enter the grounds that security forces were overwhelmed and could be seen using sticks to beat people back as they surged through the gates, an AFP correspondent said.

As the rain fell, a sea of brightly-coloured umbrellas popped up, stretching as far as the eye could see, some in the white and gold of the Vatican flag.

Throughout the mass, punctuated by bouts of joyful singing and dancing, there were prayers in Swahili, the national language, as well as in other local dialects such as Maasai, Borana and Turkana.

Over his traditional white robes, the pope wore a garment embroidered with Maasai-style beading specially made for him by a group of tailors living in Kangemi slum which he will visit on Friday.

Story continues

And when he ended his address with a few words in Swahili -- "God bless you, God bless Kenya" -- it drew thunderous applause.

"He encouraged us as families, as a nation and as different tribes and religions to work together and build our foundation on the rock which is God," said Peter Gachui, a local businessman who described the pope's address as "marvellous."

"I will remember that all my life."

- Environmental warning -

Speaking just days before the start of a key UN climate conference in the French capital, the pope delivered a powerful message, warning about the "grave environmental crisis" facing the planet.

"In a few days an important meeting on climate change will be held in Paris... It would be sad, and I dare say even catastrophic, were particular interests to prevail over the common good and lead to manipulating information in order to protect their own plans and projects," he said ahead of the summit beginning on November 30.

"We are confronted with a choice which cannot be ignored: either to improve or to destroy the environment," he said in an address at the headquarters of the United Nations Environment Programme (UNEP).

The pontiff also called for global action against the illegal trafficking of blood diamonds, ivory and other natural resources, warning it fuelled political instability and "terrorism".

Earlier, as he met with leaders of different faiths, Francis also spoke out against the radicalisation of young people and "barbarous attacks" carried out in the name of religion.

"All too often, young people are being radicalised in the name of religion to sow discord and fear, and to tear at the very fabric of our societies," the pope said nearly two weeks after young jihadists, many of them French, killed 130 people in a gun and suicide attacks in Paris.

Kenya has suffered numerous attacks since sending its army into neighbouring Somalia in 2011 after a string of kidnappings it blamed on Al-Qaeda's East Africa branch, the Shebab.

The leader of the world's 1.2 billion Catholics has also urged Kenya's leaders to work with "integrity and transparency" and to battle inequality in comments alluding to the corruption and inequality that blights the country.