Berlin, Germany - Several foreign powers signed a landmark agreement to limit external interference in the war in Libya and to push the country's warring factions towards a peaceful end to the fighting.

Speaking to journalists after a much-anticipated summit in Berlin, German Chancellor Angela Merkel and UN Secretary-General Antonio Guterres said Sunday's agreement advances a political process and rules out a military solution to the conflict, which escalated.

More:

"We reached an agreement on a comprehensive plan to support a ceasefire in Libya," said Merkel, acknowledging the road to peace in Libya would be long and arduous.

"We all agree that we should respect the arms embargo and that the arms embargo should be controlled more strongly than it has been in the past," added the German leader, though she confirmed potential sanctions for violators were not discussed in detail.

Sunday's deal marks a new stage in diplomatic attempts towards ending the country's most recent bout of fighting, which began when renegade military commander Khalifa Haftar's eastern-based forces began an assault on the capital, Tripoli, last April, leading to more than nine months of fighting in which more than 2,000 people have been killed, according to the United Nations.

Haftar and his rival, Fayez al-Sarraj, prime minister of Tripoli's UN-recognised Government of National Accord (GNA), attended but were not participants at the Berlin summit - the first to bring all parties and their backers together.

The two men did not meet directly, with Merkel citing differences of "great magnitude".

Reports of arms, troops and cash flooding into Libya from foreign allies in recent months have led to concerns over spiralling violence amid Haftar's offensive.

"That escalation that was taking place and was becoming extremely dangerous - today there was a strong commitment to stop it," said Guterres following almost four hours of talks in Berlin.

Even as world leaders convened in Germany, reports emerged of air raids and shelling in Tripoli, in apparent violation of an uneasy ceasefire brokered by Turkey and Russia on January 12.

A number of key ports and oilfields in Libya were shut down by forces loyal to Haftar on Sunday and the previous day, obstructing the resource extraction on which Libya's economy is almost totally reliant, in an apparent bid to ratchet up pressure before the summit.

'Refraining from interference'

Leaders and senior officials from Turkey, Russia, Egypt, France, the UK, Italy, the US were all in attendance at the Berlin gathering. Also present were representatives from the UAE, Algeria, China, Republic of the Congo, the United Nations, European Union and African Union.

"We commit to refraining from interference in the armed conflict or in the internal affairs of Libya and urge all international actors to do the same," read a draft declaration of the text to be signed by international leaders.

The 55-point draft communique also called for the disarming of militias, the distribution of oil resources, progress towards the formation of a single government, and free elections. Committees will be established to monitor the ceasefire and the various commitments made at the summit.

A number of European figures, including British Prime Minister Boris Johnson, German Defence Minister Annegret Kramp-Karrenbauer, and European Union foreign policy chief Joseph Borrell further suggested the possibility of deploying peacekeeping troops to Libya if a permanent ceasefire were agreed, though this was not part of the discussions.

"We should be ready to participate in any kind of efforts in order not to just complain but to be assertive and be part of the solution," Borrell told reporters.

Tim Eaton, a senior MENA researcher at Chatham House, told Al Jazeera it remained to be seen if Sunday's agreement would hold.

"According to initial reports of the outcomes, the communique signed in Berlin would appear to be akin to a gentleman's agreement that could be enforced if the will is genuine, or could soon fall apart with allegations of violations and mutual recrimination," said Eaton. "It will soon become clear which is true."

He said the US and other actors in the UN Security Council must stand behind the agreement and pressure those who violate it.

"This could be a real step forward and is the best that could have been hoped for from this gathering. However, previous experience of a complete lack of willingness to enforce the arms embargo and call out violators means that the readout from Berlin will be received with scepticism," Eaton said.

Libya has been racked by conflict and insecurity since the removal and killing of longtime leader Muammar Gaddafi in 2011 during an uprising supported by NATO forces, with rival factions and militias warring over control of the county and its significant oil wealth.

Haftar's self-styled Libyan National Army (LNA), with its headquarters in Tobruk, currently rules much of the east and south of the country, while the Tripoli-based GNA and its allies administer most of the west.

The conflict has grown into a tangled proxy war, drawing in foreign powers from the region and further afield as they pursue their own security and economic interests. Haftar has received crucial air support from the UAE and allegedly from Russian mercenary forces, as well as the backing of neighbouring Egypt.

Turkey has provided direct military assistance to the GNA, delivering drones and weapons and authorising the deployment of its forces in Libya earlier this month. Ankara has stepped up its engagement in Libya since signing a maritime treaty with al-Sarraj's government in November to grant it exploration rights in the eastern Mediterranean Sea.

Oil blockade

The Berlin conference also stressed international recognition of the Tripoli-based National Oil Company (NOC) as "Libya’s sole independent and legitimate oil company", as well as calling for an end to interference with oil facilities.

The shutdown by Haftar's forces of ports and oilfields will more than halve Libya's crude exports, plummeting from 1.3 million barrels per day to just 500,000, costing it $55m per day, according to the NOC, which has declared force majeure, meaning it cannot honour contracts because of unforeseen events.

"At the end of the day, an oil blockade is a self-defeating gambit as all actors, including Haftar's forces, require oil income to remain afloat," said Eaton.

The events, as well as reports of the ceasefire being breached, will call into question how sincere the rivals are in setting aside arms and engaging with the UN peace process, which was first proposed by Ghassan Salame, chief of the UN's Libya mission, last July.

"Long experience makes us doubt the intentions, seriousness and commitment of the other side, whom everyone knows seeks powers at any price," al-Sarraj told German news agency dpa before the meeting.

Outside the Federal Chancellery in Berlin, where discussions were taking place, pro-Haftar and pro-GNA protesters waved banners denouncing foreign interference in the conflict.

"Erdogan is the leader of terrorist groups," read one sign from Haftar supporters, while supporters of the GNA held another featuring Haftar's face and the caption: "No to the military coup".

Though Haftar's forces have become bogged down in the suburbs of Tripoli for months, continued air attacks and front-line fighting since April have seen hundreds of civilians killed and more than 150,000 forced to flee their homes, according to the UN children's fund UNICEF, which also warned that children were being recruited as soldiers.