But the recent involvement of Russia and Turkey on opposite sides of the prolonged civil war has created a new urgency for peace efforts. The conflict has turned into one of the Middle East’s most intractable proxy wars, with potentially cascading consequences for stability in Europe’s backyard.

Russia, the United Arab Emirates and Egypt are backing General Hifter. Turkey is defending the internationally recognized government in the capital.

Even within the European Union, different member countries have tacitly backed different sides, with varying intensity. France has been on General Hifter’s side, while Italy has traditionally been closer to the official government in Tripoli.

“I worry about the presence of Syrian and foreign fighters in the city of Tripoli,” President Emmanuel Macron of France planned to tell fellow leaders in Berlin, according to a draft of his speech seen by The New York Times.

“That has to stop,” Mr. Macron said. “No one must play a two-faced game.”

António Guterres, the United Nations general secretary, said: “Today all participants committed to refrain from the armed conflict or internal affairs in Libya. These must be adhered to.”

The Libyan conflict has become a test case for German and European ambitions to uphold a multilateral world order. Some saw the Berlin conference as an attempt to resurrect this sort of diplomacy in an era where multilateral agreements have been fast eroding, from the Paris climate accord to the Iran nuclear deal.

“What’s at stake is whether, in the current climate with the United States absent as the world’s policeman, it is still possible to reach international agreements with diplomacy and implement multilateral solutions,” said Daniel Gerlach, editor in chief of Zenith Magazine, a German publication specializing in the Middle East.