John Kerry in Mogadishu
U.S. Secretary of State John Kerry arrives in Mogadishu, Somalia, May 5, 2015. Reuters/Andrew Harnik/Pool

John Kerry made an unannounced visit to Somalia, marking the first time a U.S. Secretary of State has visited the unstable east African nation, authorities reportedly said.

Kerry reportedly arrived in the capital city of Mogadishu on Tuesday afternoon and was greeted by Somalia’s president and prime minister. The unannounced trip was reportedly made under tight security and the Somalian government was informed about his visit only on Monday. The country is dealing with an Islamist insurgency, and frequent attacks by the al-Shabab militant group, which have claimed thousands of lives.

"I'm glad to be here," Kerry said, according to the Associated Press (AP). "The next time I come, we have to be able to just walk downtown," Kerry, who did not venture past the airport, told Somalia's President Hassan Sheikh Mohamud. Mohamud reportedly thanked the 71-year-old American diplomat for the visit.

The U.S. backs the Somalia government in its battle against the al Qaeda-allied militants, an issue that was the main agenda of the meeting in Mogadishu. Al-Shabab, which still controls many rural parts of southern Somalia, has been weakened by African forces and U.S. drone strikes in recent years. However, the group continues to be active in the region.

Kerry's trip is designed "to reinforce the United States' commitment to supporting Somalia's ongoing transition to a peaceful democracy," spokeswoman Marie Harf said, in a statement, according to AP. "He will discuss security cooperation and Somalia's progress towards meeting its reform and development benchmarks.

"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,” Harf said.