Image copyright Reuters Image caption Mr Johnson met Libyan unity government prime minister Fayez Sarraj (right)

Libya is the front line in Europe's struggle against illegal migration and terrorism, Foreign Secretary Boris Johnson says.

On a visit to the capital Tripoli, Mr Johnson pledged more than £9m to help tackle people trafficking and terrorism.

He agreed with Libya's prime minister that the EU should do more to help tackle the migration crisis.

It was Mr Johnson's second trip to Libya this year.

The North African country has been beset by chaos since Nato-backed forces overthrew long-serving ruler Col Muammar Gaddafi in October 2011, with rival governments forming and fears about the presence of so-called Islamic State (IS).

In the latest reported violence, the spokesman of Libya's self-styled army in the east of the country said 11 people had been killed at a checkpoint they controlled in southern Libya.

'Threat to UK'

Ahead of Mr Johnson's visit, Fayyez Al-Sarraj, the head of Libya's UN-backed unity government, issued a warning that Europe faced a growing risk from terrorists unless it did more to help his country stem the massive tide of illegal migrants.

The UK foreign secretary said some of those who passed though Libya were already radicalised or could be involved in terrorism.

"Libya is the front line for many challenges which left unchecked can pose problems for us in the UK - particularly illegal migration and the threat from terrorism," he said.

"That's why it is so important that we work with the Libyan government and our partners to help bring stability to Libya, stopping it from becoming a fertile ground for terrorists, gun-runners and people traffickers in close proximity to Europe."

Image copyright Reuters Image caption £4 million will be spent removing landmines in the former IS stronghold of Sirte

The aid package includes £4m to support the removal of mines and improvised explosive devices, particularly in the city of Sirte, a former IS stronghold from which the militants were removed by Libya's military earlier this year.

'Disturbing'

Mr Johnson also said Britain would help establish a form of electronic border to the south of Libya and offered more help to its coastguard.

He agreed with Mr Al-Sarraj that the EU should be doing more to help tackle Libya's migration crisis, and also met the new United Nations special representative in Libya, Ghassan Salame, urging the international community to unite around a new UN plan expected soon.

Fionna Smyth, Oxfam's head of humanitarian campaigns, said: "It is disturbing that Boris Johnson is talking about preventing people who are fleeing violence and destitution at home from leaving Libya.

"Research we conducted with people who fled through Libya found that all but one of the women questioned had suffered sexual exploitation and three quarters of people had witnessed murder or torture.

"Aid for people travelling through Libya is welcome but Britain should be helping them to find safety not trapping them in a country where they face violence and abuse."

A note on terminology: The BBC uses the term migrant to refer to all people on the move who have yet to complete the legal process of claiming asylum. This group includes people fleeing war-torn countries such as Syria, who are likely to be granted refugee status, as well as people who are seeking jobs and better lives, who governments are likely to rule are economic migrants.