David Cameron has promised more help to improve the capacity of the police and army in Libya as he made an unannounced visit to the country.
The Prime Minister said Britain was ready to provide more training and expertise amid growing concern about the security situation in the region.
On a walkabout in the capital's famous Martyrs' Square, Mr Cameron was greeted by friendly locals wanting to shake his hand and take photographs.
The premier last visited Libya in September 2011, touring Tripoli and Benghazi shortly after Colonel Muammar Gaddafi lost his grip on power. Speaking at a press conference alongside democratically-elected counterpart Ali Zeidan, he said he was proud of the UK's support for the revolution.
Asked whether the situation in Libya would be safer if Gaddafi had not been deposed, Mr Cameron replied: "The idea that Colonel Gaddafi gave either the people of Libya or the people of Britain stability and security is a complete fiction. He was responsible for giving Semtex to the IRA. Colonel Gaddafi was responsible for the explosion over the skies of Lockerbie. Colonel Gaddafi was responsible for the death of Yvonne Fletcher."
The Prime Minister was referring to the shooting of WPc Fletcher during the Libyan embassy siege in London in 1984. Metropolitan Police officers probing the killing are due back in Libya over the coming weeks, Downing Street sources have said.
The small Lockerbie investigation team from Dumfries and Galloway Police will also be making initial contacts with the authorities in the country and discussing how their inquiry could proceed. Mr Cameron continued: "The history of brutal dictatorships in North Africa and the Middle East that we have sometimes thought might make us safer at home I think is completely wrong."
Under the package of support, the number of advisers working on training programmes for Libyan forces is being boosted from eight to 16. The number of UK police advisers is going up from two to three, and another expert will be embedded with the ministry of the interior.
Members of the Libyan navy will be invited to attend a five-month training course at Warminster. There will also be a British-funded £4.5 million job creation package focusing on ex-militia.
The Prime Minister later arrived in Liberia ahead of a high-level United Nations panel on international development.