Updated

Britain and Nigeria signed a security and defense agreement during a one-day visit by Prime Minister Theresa May on Wednesday as Africa's most populous country struggles to defeat Boko Haram extremists and others linked to the Islamic State organization.

The British prime minister is on a three-country Africa visit with a large business delegation as Britain seeks to boost economic ties ahead of a bumpy exit from the European Union in March. May also visited South Africa, another of the continent's top economies, and her next stop is Kenya.

After meeting with President Muhammadu Buhari, May said the countries will work together on "shared security threats like Boko Haram and human trafficking."

The defense aid includes more training and equipment for Nigeria's military, which has been criticized by human rights groups over alleged abuses that it denies.

Last week, Buhari attracted headlines when he told troops in northwestern Zamfara state that "as your commander-in-chief, I want you to be as ruthless as humanly possible" against bandits in the region. "Nigerians deserve some peace."

As elections approach next year Buhari is under pressure to deliver on promises to improve the country's security, in particular to defeat Boko Haram's years-long insurgency in the northeast. The extremists, known both for mass abductions and for using young women as suicide bombers, continues to carry out attacks on military bases and in Maiduguri, the capital of Borno state and the insurgency's birthplace.

Buhari and his government more than once have declared that Boko Haram had been crushed.

As Europe worries about migration and human trafficking from West Africa, May also announced a new project with France to help Nigeria, the regional powerhouse, and neighboring Niger improve border cooperation along one of the main migration routes north.

Britain also is opening new embassies in Niger and Chad and expanding its embassy in Mali, calling it support to countries "on the front line of instability" as West Africa's vast, arid Sahel is threatened by a number of extremist groups with shifting allegiances.

Britain and Nigeria also signed an agreement on economic cooperation, and May welcomed the commitment from two major Nigeria companies, Dangote Cement and Seplat Petroleum to make listings on the London Stock Exchange.

___

Follow Africa news at https://twitter.com/AP_Africa