Libya's Government of National Accord (GNA) agreed on Sunday to a ceasefire urged by Moscow and Ankara, several hours after rival strongman Khalifa Haftar announced a cessation of hostilities.
The head of the GNA, Fayez al-Sarraj, announced in a statement "a ceasefire from (Sunday) January 12 at midnight (2200 GMT)", underlining however the "legitimate right" of GNA forces to "respond to any attack or aggression that may come from the other camp".
Sarraj said the ceasefire had been accepted in response to a call from Turkish President Recep Tayyip Erdogan and his Russian counterpart Vladimir Putin, who have emerged as key players in the Libyan arena.
Late Saturday, forces of the eastern Libya-based Haftar announced a ceasefire starting Sunday at midnight in his months-long battle to take the capital Tripoli from the UN-recognised GNA, but warned of a "severe" response to any violation by the "opposing camp".
Erdogan and Putin had called for a ceasefire at a meeting on Wednesday in Istanbul, and Turkey on Saturday asked Russia to convince Haftar to respect it. Haftar had initially vowed to fight on.
Europe and North Africa have launched a diplomatic offensive to try to prevent Libya, with the increased involvement of international players in its conflict, from turning into a "second Syria".
Artillery fire was heard a little after midnight from the centre of Tripoli, seat of the GNA, before quiet settled over the southern Tripoli suburb where pro-GNA forces have been resisting Haftar's offensive launched April 4, 2019.
Ankara deployed military support to the GNA in January, while Russia, despite denials, is strongly suspected of supporting pro-Haftar forces, which are also backed by the United Arab Emirates and Egypt.
The North African state has seen an escalation of the turmoil that erupted after a NATO-backed uprising killed dictator Moamer Kadhafi in 2011.