The UN Libya envoy travelled to Tripoli and met the new prime minister designate Tuesday, in the latest sign an internationally backed unity government is asserting its authority over the capital.
Martin Kobler flew into Tripoli for his first visit since Fayez al-Sarraj arrived with members of his cabinet in the capital last week.
The UN envoy had been prevented from travelling to the capital last month by authorities in charge of the city, who have so far refused to cede power.
The new government's arrival has raised hopes it will be able to restore some stability in Libya, which has been plagued by chaos since Moamer Kadhafi's 2011 overthrow.
Kobler said on Twitter he had a "great meeting" with Sarraj and members of the unity government and that he was "moved by their courage and determination" in trying to set up in Tripoli.
He later told AFP that he also met municipal officials, adding: "We want to show that the UN and the international community support Prime Minister Sarraj and members of the presidency council."
Kobler said the UN was ready to provide "all the support needed" towards an "immediate and peaceful handover of power", and urged Libya's internationally recognised parliament to endorse the unity government.
The German diplomat, appointed last year to spearhead international efforts to resolve the Libya conflict, posted photographs of himself descending from a UN turboprop plane and then meeting with officials including Sarraj.
He was later seen walking in the streets of Tripoli's Old City, chatting with patrons in cafes and stopping for people to take selfies with him, an AFP photographer said.
Libya has had rival administrations since the Libya Dawn militia-backed alliance seized control of Tripoli in mid-2014, forcing the internationally recognised government to flee to the country's far east.
The unity government has been formed under a power-sharing deal agreed by some lawmakers in December.
Sarraj arrived by sea last Wednesday after the Tripoli authorities closed airspace to keep him out, and has since been operating out of a naval base.
The new administration has been broadening its support, winning the backing of the Libyan Investment Authority, the National Oil Corporation and the Central Bank.
Ten coastal cities that were under the control of the Tripoli authorities have also backed the new government.
Mattia Toaldo, a policy fellow at the European Council on Foreign Relations, said Kobler's visit was a clear signal that the Government of National Accord (GNA) was putting down roots in the capital.
"Kobler's visit to Tripoli, after the many times he was refused landing and access... shows the degree of control of Tripoli by the GNA," Toaldo said.
An adviser to Kobler said the UN envoy discussed with Sarraj "ways to support the action" of the unity government.
Western governments are deeply concerned that Libya's disarray has allowed the jihadist Islamic State group (IS) to gain an important foothold in the country, but have said a foreign intervention can only take place at the request of a unity government.
Most foreign representations have long since left the capital but Tunisia on Monday said it was reopening diplomatic missions in Tripoli following the new government's arrival.
French Foreign Minister Jean-Marc Ayrault praised Tunisia's decision on Tuesday and expressed hope for an eventual return of other embassies.
"The question of the return of our embassies is obviously a relevant one," he told reporters in Paris after talks with German counterpart Frank-Walter Steinmeier.
"We hope that this situation consolidates itself. If the Libyan government asks us to help it ensure its security, we are available."
Kobler said the people he met on the streets of the Old City "specifically demanded the return of the embassies and the United Nations to Tripoli".