Italy's foreign minister visited Tripoli on Tuesday to bolster the unity government struggling to end Libya's chaos, in the first visit by a top Western official since 2014.
Paolo Gentiloni flew into the capital amid tight security and held talks with Fayez al-Sarraj, named prime minister-designate under a UN-backed power-sharing deal in December.
World powers see the unity cabinet as vital to tackling a raging militant insurgency and rampant people smuggling in the North African state.
"I am delighted to be in #Tripoli for Italy's emergency aid and to support al-Sarraj's Government of National Accord," Gentiloni wrote on Twitter.
Sarraj arrived in Tripoli by sea with a naval escort nearly two weeks ago and established his headquarters at a naval base.
He has since won the support of key institutions that control Libya's wealth and also appears to have the backing of at least some militias.
But he has not received the endorsement of the country's internationally recognised parliament, while the head of a rival Tripoli-based administration has refused to recognise his authority.
The recognised legislature will, however, meet in the coming weeks to consider giving its support to the unity government, its speaker said Sunday.
Libya has been plagued by instability since the 2011 uprising that ousted longtime ruler Muammar Gaddhafi, with the Islamic State (IS) group taking advantage to seize territory.
US President Barack Obama has admitted that the biggest mistake of his presidency was a lack of planning for the aftermath of Gaddhafi's downfall.
Obama has repeatedly acknowledged that the United States and its allies could have done more to prevent Libya's descent into chaos following the NATO-backed uprising in 2011.
Asked in a Fox News interview aired Sunday to name the "worst mistake" of his presidency, the US leader said it was "probably failing to plan for the day after what I think was the right thing to do in intervening in Libya."
The oil-rich country has had two rival administrations since mid-2014 when a militia alliance overran Tripoli, setting up its own authority and forcing the recognised parliament to flee to the remote east.
Italy has played a leading role in international efforts to pressure Libya's warring rivals to rally behind the unity government.
European nations in particular have been alarmed by the expansion of IS in Libya, located just 300 kilometres (185 miles) away from Italy across the Mediterranean.
The militant group last year seized control of Gaddhafi's coastal hometown of Sirte and has been fighting to expand to other areas.
The number of IS group fighters in Libya has doubled in the past 12-18 months and now stands at about 4,000 to 6,000, the head of US forces in Africa, General David Rodriguez, said last week.
The Italian foreign ministry did not say how long Gentiloni's visit would last, though a UN-backed conference on Libya was being held in Tunis on Tuesday.
Those talks, attended by representatives of dozens of countries or international organizations, are aimed at helping the unity government to define its priorities, according to the UN.
As well as tackling IS group, European governments hope the unity government can crack down on people smugglers who have stepped up their lucrative business in Libya amid the chaos.
Libya has long been a stepping stone for migrants, and there are concerns that European efforts to shut down the migrant sea crossing from Turkey to Greece will encourage more people to leave from North Africa.