Boris Johnson has called on Libya's factions to work together for peace after making his first visit to the country.
The Foreign Secretary urged leading figures to "sieze the momentum" generated by crucial talks this week between prime minister Fayez Sarraj and rival Khalifa Haftar, who heads the Libyan National Army that dominates eastern areas of the state.
Libya was plunged into chaos following the overthrow of Muammar Gaddafi in 2011 and the power vacuum fuelled a wave of violence and terror in the nation.
Mr Johnson met Mr Sarraj, who leads the UN backed Government of National Accord, in Tripoli to discuss British support to bring about security in the state.
He said: "Libya's political and social groups need to seize the momentum offered by the welcome meeting between Prime Minister Sarraj and Marshal Haftar earlier this week to set out a path towards Libyan reconciliation and unity.
"Security, stability and prosperity can only be achieved when the country's leaders choose to get together and work out a plan for the common benefit of the Libyan people.
"Establishing effective governance is also the key to defeating terrorism in Libya and countering illegal migration."
The talks follow meetings in Tunis on Wednesday with counterpart Khemaies Jhinaoui on fighting terrorism, improving the Tunisian security situation and boosting trade.
Mr Johnson said: "The UK is a long term partner and friend of Tunisia and will continue to cooperate closely on security, counter-terrorism and trade."