NAIROBI, Kenya — British Prime Minister Theresa May on Thursday became the first UK leader to visit Kenya in 30 years, bringing security and development funding to East Africa's commercial hub and neighboring Somalia as Britain seeks to boost economic ties ahead of a bumpy exit from the European Union in March.

May met with President Uhuru Kenyatta on the last stop of her three-country Africa tour, which also included South Africa and Nigeria, the continent's top economies. The prime minister was travelling with a large business delegation as Britain wants to push its trade with Africa beyond the 31 billion pounds ($40.2 billion) registered last year.

"I want to ensure that the UK's relationship with Kenya and with Africa is more and more about private investment, about doing business and making the most of commercial opportunities together," she told reporters after meeting with Kenyatta. Britain is Kenya's largest foreign investor.

No British leader had visited Kenya since Margaret Thatcher, and this is the first visit by a British prime minister to Africa in five years.

Kenyatta for a moment appeared to struggle to remember the name of former British Foreign Secretary Boris Johnson, calling him "Boris ... Boris Johnson, the bicycle guy. The bicycle guy, yeah, that one." Johnson has been an outspoken advocate of cycling in London.

Kenya, a former British colony, is a key ally in East Africa on trade and security. The British military has run a training camp for Kenyan troops for years.

May visited the British troops in Kenya's capital, Nairobi, who help to train peacekeepers with a multinational African Union mission in Somalia to handle the threat of explosives used by the al-Qaida-linked al-Shabab extremist group, the deadliest Islamic extremist group in sub-Saharan Africa.

Britain's government said May's visit brought 7 million pounds in new funding for the AU peacekeeping mission, as well as 60 million pounds to help Somalis recover from drought. Another 25 million pounds will go toward helping the fragile Horn of Africa nation's government, which is struggling to assert control beyond the capital, Mogadishu, and certain other urban centers.

Al-Shabab is a constant threat in Kenya after the extremist group vowed retribution for that country sending troops to Somalia. Dozens of Kenyan police have been killed in bombings in recent months.

"We have democracy in common and we need to defend it together. And as for our common enemies such as terrorism we need to fight them together," Kenyatta said.

May noted Kenyatta's call for a transition from the AU peacekeepers to stronger Somali security forces and said Britain wants the same, adding that the UK is leading efforts to ensure the AU mission receives the funding it needs.

Concerns about the readiness of Somali troops to take over the country's security, however, remain high. The U.N. Security Council recently voted to delay the reduction of troops in the AU force from October to February and the target date to hand over security to Somali forces to December 2021.

May also pointed out Kenya's new push to combat widespread corruption, and the UK signed a new deal with the country to return stolen money hidden in British banks. The returned money will be used exclusively for development projects.