"We declare a ceasefire from midnight (2200 GMT) Sunday," the army said, stressing however that it would continue to pursue "terrorists", as UN-brokered peace talks resume in Geneva next week.
The army also said it would monitor the situation on the ground "to prevent any change in front lines or transportation of weapons and ammunition," which it would consider a violation of the truce.
Soldiers "have been given the right to defend themselves if they come under fire," the statement added.
Libyan armed forces spokesman Colonel Ahmed Mesmari said the army was "engaged in pursuing its duty to protect the Libyan people".
He said the military would "ensure the security and stability of the country and combat terrorism" in Libya.
On Friday, the Fajr Libya (Libya Dawn) militia alliance said it had agreed to a ceasefire in the North African country on the condition rival factions respected the truce.
It also pledged to open up "safe passages to channel humanitarian aid", especially in Libya's battleground second city of Benghazi.
The army's announcement came after the UN Security Council welcomed the Fajr Libya ceasefire and threatened to impose sanctions on any party that obstructed peace efforts.
"There can be no military solution to the crisis in Libya," the council said in a unanimous statement on Saturday.
It warned it was "prepared to sanction those who threaten Libya's peace, stability or security or that obstruct or undermine the successful completion of its political transition."
The internationally-recognised government and elected parliament decamped last summer to the country's far east after Fajr Libya seized Tripoli and set up its own administration.
The militia alliance also holds the third city, Misrata, and it launched a bloody offensive in December to seize control of key oil terminals but was repelled by the army.
