But it listed several conditions, saying the ceasefire must be observed "in all combat zones"
Forces battling for control of Libya's capital agreed to a truce Saturday, on the eve of the Muslim festival of Eid Al-Adha, but a car bomb killed three UN staff in the eastern city of Benghazi.
Military strongman Khalifa Haftar's forces announced that they would implement a ceasefire, after the unity government conditionally accepted the truce for the three-day holiday which starts Sunday.
Haftar's self-styled Libyan National Army (LNA) has been fighting since early April to seize Tripoli from the UN-recognised Government of National Accord.
The United Nations had called on both sides to commit to a humanitarian truce by midnight on Friday.
Haftar's spokesman Ahmad al-Mesmari on Saturday announced "a halt to all military operations... in the suburbs of Tripoli".
Mesmari said the truce had gone into effect at 3:00 PM (1300 GMT) on Saturday and would last until the same time on Monday afternoon.
The GNA had said late Friday it was keen to "ease the suffering of the citizens and allow rescue workers to accomplish their mission" and would accept "a humanitarian truce for Eid al-Adha".
But it listed several conditions, saying the ceasefire must be observed "in all combat zones, with a cessation of direct and indirect fire and movement of troops".
It added that the truce must include "a ban on flights and reconnaissance overflights" across the country's entire airspace.
The GNA also called on the UN mission in Libya (UNSMIL) to "ensure the implementation of the truce and note any breaches".
Haftar's spokesman said the ceasefire was "out of respect for this occasion's place in our spirits... so that Libyan citizens can celebrate this Eid in peace".
But in Haftar-controlled Benghazi, a car bombing killed three UN staff and injured three more, the UN said.
"Three United Nations colleagues were killed in the bombing and three others are among the injured," it said in a statement.
Secretary-General Antonio Guterres condemned the attack "in the strongest terms" and called on the Libyan authorities "to spare no effort in identifying and swiftly bringing to justice the perpetrators of this attack".
He also urged all parties to "respect the humanitarian truce... and return to the negotiating table".
Previously, a security official had said that eight other people were injured, including a child.
Thick black smoke rose from the area and firefighters rushed to put out the flames that gutted two cars, including a white vehicle like those used by the UN.
No side had claimed responsibility for the blast.
The UN's Libya envoy Ghassan Salame called the incident a "cowardly attack".
It "serves as another strong reminder of the urgent need for Libyans to stop fighting, set aside their differences and work together through dialogue and not violence to end the conflict," he said in a statement.
The European Union called the attack "contemptible and a further worrying development in the Libyan crisis", urging all sides to abide by the UN-brokered truce.
The blast came just months after the UN reopened its offices in Benghazi, which had been closed for security consideration, and less than a month after a car bombing at the funeral of an ex-army commander killed at least four people and wounded more than 30 others.
Haftar's forces have controlled Libya's second city since 2017, when he drove hardline Islamists and jihadists out after a three-year battle.
But Benghazi, the cradle of the NATO-backed 2011 uprising that overthrew and killed dictator Moamer Kadhafi, has seen repeated attacks both before and since.
One attack on the US consulate on September 11, 2012, killed US ambassador Christopher Stevens and three other Americans.
A May 2018 attack left seven people dead.
A Libyan lawmaker is also feared to have been abducted by an armed group in the eastern city, the UN and lawmakers said in July.
Haftar, who backs an eastern-based administration that opposes the Tripoli-based unity government, advanced into the country's desert south this year before turning his sights on Tripoli.
Over the past four months, 1,093 people have been killed in the fighting and 5,752 wounded, according to the World Health Organization (WHO), while more than 120,000 people have been displaced.
Forces loyal to the GNA are keeping Haftar's troops at bay on the southern outskirts of the city.
UN envoy Ghassan Salame had already called several times for humanitarian truces, without success.
In a video conference with the UN Security Council late last month, Salame warned against mounting tensions and called for a ceasefire for Eid Al-Adha.