John Kerry set to visit Paris to condemn France attacks
John Kerry launched talks on al-Shabab, which he said is more dangerous than ever Rick Wilking/Reuters

John Kerry became the first US secretary of state in history to visit Somalia when he made a surprise trip to the capital Mogadishu. But he's not leaving the heavily fortified airport because of security worries.

Kerry was greeted by Somalia's President Hassan Sheikh Mohamud, who hailed the visit as a "great moment" for the battle-battered nation. "Thank you for the time to be with us," added Mohamud, who got word of the trip only the day before Kerry landed.

"I visited Somalia today because your country is turning around," Kerry told him, the BBC reports.

A senior State Department official told Al Jazeera that the trip was intended to send a message to al-Shabab fighters "that we are not turning our backs on the Somali people and will continue to engage with Somalia until we bring al-Shabab terror to an end."

Kerry immediately launched into meetings about the continuing threat from al-Shabab that were to include Mohamud, the prime minister, provincial leaders and civilian groups. All the meetings were scheduled at the airport, which is protected by a heavily fortified perimeter.

While al-Shabab militants continue to dominate several rural areas in the south, African forces and US drone strikes have largely crippled the organisation's leadership and deprived the group of much of the territory fighters once controlled. But the organization in many ways has now become even more dangerous. The militants have expanded activities in neighboring nations, including to Kenya, where al-Shabab gunman shot dead 148 students at Garissa University last month.

Blast in Somalia's Mogadishu airport
Somali security forces rush to the site of a blast near the heavily fortified gates of the airport in Mogadishu Mohamed Abdiwahab/AFP/Getty Images

Kerry's trip is designed "to reinforce the United States' commitment to supporting Somalia's ongoing transition to a peaceful democracy," State Department spokeswoman Marie Harf said in a statement.

"He will discuss security cooperation and Somalia's progress towards meeting its reform and development benchmarks," she said. "He will also meet with civil society leaders to discuss the importance of a vibrant NGO sector and thank African Union troops for their role in stabilizing Somalia."

The US has a particularly painful history in the nation. American troops were sent there in 1992 on a peacekeeping mission to help stave off a famine. But they left two years later after the "Black Hawk Down" tragedy when Somali militiamen shot down two US helicopters. Eighteen servicemen were killed in the crash and rescue attempt, with the bodies of several dragged through Somalia's streets.

But America has provided Somalia with hundreds of millions of dollars in military support and is attempting to nudge the nation into a more representative government in a bid for more stability

But Kerry's inability to travel into the nation is a testament to the continued volatility of the region.

"The next time I come, we have to be able to just walk downtown," Kerry told Mohamud, who warned that the centre of the city "is very different now."