British Prime Minister David Cameron, on a surprise visit to Tripoli, said on Thursday Britain would help train Libya's security forces.
After flying in from Algiers, where he also pledged to cooperate on security and intelligence to counter Islamist militancy in the region, Cameron visited a police training academy and Martyrs' Square in the Libyan capital.
Cameron has called North Africa and the Sahel a "magnet for jihadists" and warned of a "generational struggle" against them, after at least 38 hostages died in an Islamist attack on an Algerian gas complex earlier this month.
However, he has shied away from a major military response and instead espoused empowering regional governments to take the lead in security and bolstering the rule of law and democratic institutions.
"There is no true freedom and no true democracy, without security and stability as well. We are committed to helping with that both here and also in your neighbourhood," Cameron said at a news conference with Libyan Prime Minister Ali Zeidan.
"We've agreed a package of additional help from Britain to Libya - increasing the military training we are providing, increasing the police advisers ... We've also discussed how we can help build the institutional capacity of the new Libyan government," he added.
Cameron last visited Libya in 2011 along with then French President Nicolas Sarkozy after rebels ousted former Libyan leader Muammar Gaddafi with French, British and U.S. backing.
At the time he called Benghazi, the cradle of the uprising against Gaddafi, an "inspiration to the world".
Since then, Libya's second city has been disrupted by violence and become a base for Islamist militant groups. Last September an attack on the U.S. diplomatic mission killed the U.S. ambassador to Libya and three other Americans.
Last week Britain urged its citizens to evacuate the city, citing a "specific, imminent" threat, irking Libyan officials keen to attract foreign money and expertise after decades of under-investment during Gaddafi's rule.
"Our security situation is good, we are recovering, things are getting better ... I would like to highlight that what was raised about Benghazi is just some propaganda, made by opponents to the Feb 17th revolution," Zeidan said.
Cameron highlighted the two countries' shared interest in boosting security in Libya, highlighting cooperation on investigations into the 1988 Lockerbie airplane bombing and the 1984 shooting of police officer Yvonne Fletcher outside the Libyan embassy in London.