The Libyan army has declared a partial ceasefire, two days after some of the militias based in western Libya announced a unilateral truce.
The ceasefire was due to begin at midnight on Sunday (22:00 GMT).
They added that their forces would adhere to the truce but would continue to pursue "terrorists".
The decision comes after the first round of UN-sponsored talks in Geneva last week that seek to end months of escalating violence in Libya.
Libya has been plagued by instability and infighting since Colonel Muammar Gaddafi was ousted from power in 2011.
Forces from the internationally-recognised government have been battling militias in different parts of the country.
The army's ceasefire declaration comes after some factions from an alliance of militias controlling the capital, Tripoli, announced a truce on Friday.
The Libya Dawn militia alliance also said that it would open up "safe passage to channel humanitarian aid", according to the AFP news agency.
After declaring a truce on Sunday, the Libyan army said that it would monitor the situation to "prevent any change in front lines of transportation of weapons and ammunition" which would violate the ceasefire.
The BBC's Rana Jawad in Tripoli says that the terms of the ceasefire mean that the battles in the city of Benghazi, where the army is fighting against Islamist militants, are likely to continue.
The UN mission to Libya welcomed the announcement, calling it a "significant contribution" to the country's peace process.
It added that it would coordinate with both sides "regarding tackling any breaches" and that the truce would allow the flow of humanitarian aid to those who have fled the fighting.
The UN-sponsored talks in Geneva are due to resume next week.
Earlier on Sunday, the rival parliament of The General National Congress (GNC) declared that they were ready to take part in the talks but only if they take place in Libya.
The internationally-recognised government and elected parliament had to move to the east of the country in 2014, after militias seized Tripoli and revived the old GNC parliament.
The militia alliance also holds the city of Misrata and launched an offensive in December to seize key oil terminals but was repelled by the army.