British Foreign Secretary Boris Johnson has made a surprise visit to Somalia as a worsening drought threatens millions of people with starvation in the Horn of Africa nation.

Johnson met President Mohamed Abdullahi Mohamed on Wednesday in the Villa Somalia presidential palace in central Mogadishu.

"It is all so, such a shame that you are facing the problems that you are facing, particularly of course the drought and the risk of starvation, though I think that we are moving fast to try to tackle that," Johnson told Mohamed.

Somalia recently declared the drought a national disaster amid warnings of a full-blown famine. At least 360,000 Somali children are severely malnourished, meaning that they will die within weeks unless they receive food aid.

The country faced a similar crisis in 2011 that killed nearly 260,000 people.

Johnson said the United Kingdom would host a conference on Somalia on May 11 to help address "underlying problems" such as armed attacks and corruption.

WATCH: What can be done to save millions facing famine?

Mohamed, also known as Farmajo, blamed the drought in part on the armed group al-Shabab, which continues to control parts of the country.

"This drought is really serious, and so far we have lost 60 percent of our livestock," the president said.

A statement from the Somali president's office said Britain would give $134m for drought in some parts of Somalia.

National disaster

The current drought, which the United Nations says threatens half of Somalia's population, or about six million people, is part of a four-nation humanitarian crisis that the UN has called the largest in the past 70 years.

Stephen O'Brien, the UN humanitarian chief, said after his recent visit to Somalia that 2.9 million people required immediate help "to save or sustain their lives".

He said close to one million children under the age of five would be acutely malnourished this year.

"The window is short in which we can still avert a famine," Nigel Tricks, Oxfam's Horn of Africa regional director, said on Wednesday.

The drought also affects millions of people in parts of Ethiopia and Kenya, where the government recently declared a national disaster for about half of its counties.

Famine has been declared in two counties of civil war-torn South Sudan.