Haftar's forces "announce a halt to all military operations... in the suburbs of Tripoli," Ahmad al-Mesmari, a spokesman for Libyan military strongman Khalifa Haftar, said at a press conference in the eastern city of Benghazi Saturday.
Mesmari said the truce had gone into effect at 3:00 PM on Saturday (1300 GMT) and would last until the same time on Monday afternoon.
The move came after Libya's UN-recognised Government of National Accord (GNA) said it would accept a "humanitarian truce for Eid al-Adha," which starts on Sunday and lasts three days.
The United Nations had called on the two sides to commit to a humanitarian truce by midnight on Friday.
Haftar's forces have been fighting since early April to seize Tripoli from the GNA.
Over the past four months, more than 1,000 people have been killed and over 5,000 injured, according to the World Health Organization.
The UN meanwhile reckons that more than 120, 000 people have been displaced due to the clashes.
The GNA of Prime Minister Fayez al-Sarraj said it had agreed to the truce to "ease the suffering of citizens and allow rescue workers to accomplish their mission".
But the GNA 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 also said 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".
Despite the truce, it remains unclear whether the ceasefire will hold.
It was announced as a car bomb was set off in Benghazi killing two UN staff, several medical sources confirmed to the Reuters news agency.
The explosion happened in front of a shopping centre and bank. At least one burned-out UN car could be seen at the scene.
There was no immediate claim of responsibility for the blast, which happened as a UN convoy was passing through the area.