Libya's government is declaring an immediate ceasefire after a UN Security Council resolution backed "all necessary measures" short of occupation to protect civilians in the country.
Libyan Foreign Minister Mussa Kussa said the ceasefire was intended "to protect civilians".Western powers had been discussing how to enforce the UN resolution.
It was passed as troops loyal to Libyan leader Muammar Gaddafi advanced on the rebel-held second city of Benghazi.
Before the announcement of the ceasefire, heavy fighting between pro-Gaddafi forces and rebels was reported to be continuing.
Rebels said government forces had also been bombarding the western city of Misrata.
UN Security Council Resolution 1973 gave broad backing to taking military action against all threats to civilians, which correspondents say could include bombing Col Gaddafi's forces on the ground if necessary.
Rebel forces in Benghazi reacted with joy to the UN resolution, but a government spokesman condemned UN "aggression". One of Col Gaddafi's sons, Saif al-Islam, said the resolution was "unfair" as Libya had not been bombing civilians.
British Prime Minister David Cameron said Britain would judge Col Gaddafi "by his actions not his words" after Libya said it was declaring a ceasefire to comply with the resolution."What is absolutely clear is the UN Security Council resolution said he must stop what he is doing, brutalising his people. If not, all necessary measures can follow to make him stop," he told the CA.
"That is what we agreed last night, that is what we are preparing for and we'll judge him by what he does."
Mr Cameron had earlier said Britain was preparing to move Tornado and Typhoon fighter-bomber aircraft to bases near Libya.
French foreign ministry spokesman Bernard Valero told Reuters TV: "We have to be very cautious. He (Gaddafi) is now starting to be afraid, but on the ground the threat has not changed."