Libyan strongman Khalifa Hifter has agreed to abide by a cease-fire and said he was ready to participate in an international conference in Berlin on Sunday, Germany’s foreign minister said.

Libya’s U.N.-recognized government in Tripoli has been under attack since April from Hifter’s forces, with clashes killing more than 280 civilians and 2,000 fighters and displacing tens of thousands.

The leaders of the North African state’s warring factions were in Moscow early this week at talks aimed at finalizing a cease-fire orchestrated by Russia and Turkey.

“During my visit to Libya today, General Haftar made clear: He wants to contribute to the success of the Libyan conference in Berlin and is in principle ready to participate in it. He has agreed to abide by the ongoing ceasefire,” German Foreign Minister Heiko Maas tweeted after talks in Benghazi.

After the Moscow talks, Hifter had walked away without signing the permanent truce, sparking fears about the shaky cease-fire.

Maas had traveled to meet Hifter in the eastern Libyan city of Benghazi — one of the general’s strongholds — in a bid to persuade him to join in the peace initiative.

The trip came days after Maas spoke with Hifter’s rival, Fayez al-Sarraj, who serves as head of the U.N.-recognized government in Tripoli.

Separately in Tripoli, Sarraj announced he would attend the Berlin talks held under the auspices of the United Nations.

The battle over Tripoli is the latest unrest to wrack Libya since a 2011 NATO-backed uprising killed dictator Moammar Gadhafi. Since then, Libya has been caught up in fighting between rival armed factions, including Islamist militants.

In his report to the U.N. Security Council late on Wednesday, U.N. chief Antonio Guterres urged all warring parties to stop fighting and “engage constructively towards that end, including within the Berlin process.

He also warned against “external interference,” which he said would “deepen the ongoing conflict and further complicate efforts to reach a clear international commitment to a peaceful resolution of the underlying crisis.”

The Berlin conference will aim to agree six points including a permanent ceasefire, implementation of the arms embargo and a return to the political process for peace, Guterres said.

As well as killing hundreds of people, the fighting in Libya has also spurred a growing exodus of migrants, though nearly 1,000 intercepted at sea have been forced to return this year, according to the U.N.