Germany has reopened its embassy in Libya as its Foreign Minister, Heiko Maas, arrived in Tripoli and said planned December elections must take place.
The German mission to Libya had been based in neighbouring Tunisia since 2014, when almost all embassies closed Tripoli as violence broke out in the capital.
“The fact that I am primarily talking about civic participation rather than civil war in Tripoli today is a genuine step forward," Mr Maas said on his arrival.
Last October a ceasefire was agreed to between armed groups. It has largely held.
It paved the way for an interim government, which took office this year, with presidential and parliamentary elections scheduled to take place in December.
But there are concerns that they may be delayed as politicians argue over the legal framework for them to take place.
Germany has tried to act as an intermediary between the competing factions in Libya and has hosted summits with key international players and Libyan figures.
“The former parties to the conflict have acknowledged that there can be no violent solution for their country,” Mr Maas said.
“For lasting stability, Libya now needs nationwide elections to give rise to political institutions.
“That is why it is so crucial that these elections take place. The separation of powers instead of violence is the challenge that the country faces right now.”
He praised the country's efforts to improve stability over the past two years.
“Today there's a national unity government, the oil blockade has been ended and the weapons have mostly been silenced,” Mr Maas said.
“Libya needs continued international engagement to achieve progress for all people in Libya. It is for this reason that I came to Tripoli to reopen the German embassy here."
Meanwhile, the Speaker of Libya's eastern-based parliament signed a law allowing the presidential election to take place on December 24, although another body rejected the move, saying the legislation was flawed.
Aguila Saleh has sent the law to other political bodies and to the UN, a spokesman said.
The High State Council, a body empowered by a political agreement in 2015, said Mr Saleh had unilaterally pushed the law through using powers he did not hold.
The council said he did so to "obstruct the upcoming elections by deliberately issuing a flawed law".
The eastern-based parliament, elected in 2014, has not yet agreed on a law for a parliamentary election.
Its law on the presidential election would allow serving officials to stand for office if they temporarily stepped down from their posts three months before the vote.
Parliament agreed on the bill last month and sent it to the legal committee, but did not hold another vote on it before Mr Saleh issued it as law.
There are doubts as to whether the election will take place.
"It's more and more unlikely by the day. There just isn't enough time," said Tarek Megerisi, of the European Council on Foreign Relations.