Both sides in Libya's conflict agreed to a ceasefire from Sunday to end nine months of fighting, following weeks of international diplomacy and calls for a truce by power-brokers Russia and Turkey.
The oil-rich North African country has been wracked by bloody turmoil since a 2011 NATO-backed uprising killed long-time dictator Moamer Kadhafi, with multiple foreign powers now involved.
The UN-recognised Government of National Accord (GNA) in Tripoli had been under attack since last April from forces loyal to eastern-based strongman Khalifa Haftar, which on January 6 captured the strategic coastal city of Sirte.
Late on Saturday, Haftar's forces announced a ceasefire starting at midnight (Sunday 00:00 local time, Saturday 2200 GMT) in line with a joint call by Turkish President Recep Tayyip Erdogan and his Russian counterpart Vladimir Putin.
GNA head Fayez al-Sarraj followed suit early Sunday, confirming the ceasefire had taken effect.
The UN mission in Libya welcomed the announcements and called on all parties "to respect the ceasefire" and support efforts to launch an inter-Libyan dialogue.
Likewise, the Arab League urged Libya's factions to "commit to stop the fighting, work on alleviating all forms of escalations and engage in good faith aimed at reaching permanent arrangements for a ceasefire".
Since the start of the offensive against Tripoli, more than 280 civilians and about 2,000 fighters have been killed and 146,000 Libyans displaced, according to the United Nations.
Sarraj stressed the GNA's "legitimate right ... to respond to any attack or aggression" that may come from the other side, while Haftar's forces warned of a "severe" response to any violation by the "opposing camp".
Artillery fire could be heard shortly after midnight in the capital, before quiet settled over the southern Tripoli suburb where pro-GNA forces have been resisting Haftar's offensive.
Contacted by AFP at noon, a spokesman for the pro-GNA forces, Mustafa al-Mejii, reported "a calm situation so far on the frontlines".
The GNA later reported "violations" by "pro-Haftar militias" in the Salaheddine and Wadi al-Rabii areas south of the capital, "minutes after the ceasefire came into effect".
It also reiterated its "immutable position" that "any ceasefire initiative cannot succeed without the withdrawal of the aggressor from where they came", from the country's east and south.
Turkey's defence ministry said: "The belligerents have been trying to respect these truces since they came into force... and the situation has been calm apart from one or two isolated incidents."
The truce comes after a diplomatic offensive, led by Ankara and Moscow, which have established themselves as key players in Libya.
Ankara despatched military support to the GNA in January.
And Russia has been accused of backing pro-Haftar forces, which are also supported by the United Arab Emirates, Saudi Arabia and Egypt, all regional rivals of Turkey.
Erdogan and Putin called for a truce at a meeting last Wednesday in Istanbul, and Turkey later asked Russia to convince Haftar, who had initially vowed to fight on, to respect it.
Fears of a 'second Syria'
Europe and North Africa have also 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".
European governments, also including former colonial power Italy, fear that Islamist militants and migrant smugglers, already highly active in Libya, will take further advantage of the chaos.
The US embassy in Libya, in a statement Saturday, voiced its "serious concern about toxic foreign interference in the conflict".
It said "Russian mercenaries" had backed Haftar's Libyan Arab Armed Forces, while "Turkish-supported Syrian fighters" had backed the GNA, a development that had "significantly degraded security, to the detriment of all Libyans".
"All responsible Libyan parties should end this dangerous escalation and reject the destructive involvement by foreign forces," the embassy said.
On Saturday, Putin and German Chancellor Angela Merkel at talks in Moscow threw their weight behind a Libya peace conference in Berlin being organised by UN special envoy Ghassan Salame that could be held in the coming weeks.
Putin on Saturday again denied Russia had deployed mercenaries to Libya, saying: "If there are Russians there, they do not represent the interests of the Russian state and do not receive money from it."