World powers see the Government of National Accord (GNA) as a crucial partner in tackling jihadists behind a string of deadly attacks in Libya as well as human traffickers exploiting the country's turmoil.
France's Jean-Marc Ayrault and Germany's Frank-Walter Steinmeier flew into the capital amid tight security for talks with the UN-backed cabinet which has set up operations at a naval base in the city.
Steinmeier described the visit as a signal that the international community is united behind the GNA.
“The way to peace and stability is through the implementation of the peace agreement and the government of national unity,” Steinmeier said in remarks released by his ministry.
It is the latest in a flurry of visits by European diplomats who had been absent since 2014 when EU member states closed their Tripoli embassies as fighting shook the North African nation.
Their return was prompted by the arrival of UN-backed prime minister-designate Fayez al-Sarraj on March 30th by sea with a naval escort, after a rival Tripoli authority shut the airspace to try to keep him out.
“France was one of the first countries to back Sarraj, and the time has come to give a new impetus to that support,” a French diplomat said.
The visit comes two days before a crucial vote by the country's recognised parliament on whether to endorse the GNA, and ahead of talks in Luxembourg next week on a possible EU mission to assist Libya's police and border guards.
Italy's Foreign Minister Paolo Gentiloni hailed the unity government as a “game changer” when he visited Tripoli on Tuesday.
The British, French and Spanish ambassadors flew in for talks two days later, saying they were working towards reopening their diplomatic missions there.
European nations are increasingly alarmed by the expansion of the Islamic State jihadist group in Libya, where it has established a new stronghold just 300 kilometres (185 miles) away from Italy across the Mediterranean.
The jihadists last year seized control of slain dictator Moamer Kadhafi's coastal hometown of Sirte and have used the city as a base to stage a string of suicide bombings and attacks on oil facilities.
IS claimed responsibility for a car bombing on Friday near the city of Benghazi that security sources said left two soldiers of the internationally recognised government dead and three wounded.
The jihadists claimed to have killed as many as 50 soldiers and destroyed 15 vehicles in the attack.
Oil-flush Libya descended into chaos after the 2011 NATO-backed uprising that ousted and killed Kadhafi.
The country has had two rival administrations since mid-2014 when a militia alliance took over Tripoli, setting up its own authority and forcing the recognised parliament to flee to the remote east.
A UN-backed power-sharing deal in December was backed by some lawmakers by both sides.
But Sarraj has not yet received the endorsement of the internationally recognised legislature, and the head of the rival Tripoli-based administration, Khalifa Ghweil, has refused to recognise his authority.
Mattia Toaldo, a policy fellow at the European Council on Foreign Relations, said the European visit was “timely”, coming days ahead of the confidence vote in parliament and the meetings of EU foreign and defence ministers.
Sarraj is expected to participate in the Luxembourg talks, probably by videolink.
“So maybe the visit is not just symbolic — they (Ayrault and Steinmeier) want to have a real discussion with Sarraj,” Toaldo said.
The diplomatic push takes place against a backdrop of growing concerns that European efforts to shut down the migrant sea crossing from Turkey to Greece will encourage more people to set off from North Africa instead.
Nearly 6,000 mostly African migrants have landed at southern Italian ports since Tuesday, adding to concerns that the country is on the verge of becoming the main entry point for people trying to reach Europe.