A draft UN resolution tabled by the UK, France and Lebanon on Tuesday proposed a ban on all flights in Libya, authorised member states to enforce it and called on them to participate in it.
The UN resolution rules out a foreign occupation force in any part of Libya.
The resolution imposes a "ban on all flights in Libyan airspace", with aid flights the only exception.
It authorises member states to "take all necessary measures" to "protect civilians and civilian populated areas under threat of attack", including in the rebel stronghold of Benghazi.
It also calls for an immediate ceasefire, an end to the violence, measures to make it more difficult for foreign mercenaries to get into Libya and a tightening of sanctions.
UK forces are preparing to help enforce a no-fly zone over Libya after the UN backed "all necessary measures", short of an invasion, to protect civilians.
'No mercy'
Ten UN Security Council members backed the resolution while five abstained - nine votes were needed for it to pass.
Libyan leader Col Muammar Gaddafi's forces have recently retaken several towns seized by rebels in an uprising.
Rebel forces in Benghazi reacted with joy to the passing of the resolution but a Libyan government spokesman condemned UN "aggression".
Loyalist forces are bearing down on Benghazi, home to a million people. Forces loyal to Col Gaddafi have reportedly launched their first air attacks on the town, targeting the airport at Benina.
Col Gaddafi had earlier warned the rebels there that his troops were coming and to expect "no mercy".
The resolution would permit air strikes on Libyan ground troops or allow attacks on Libyan war ships if they were attacking civilians.
Continue reading the main story
Resolution 1973
UN Security Council members vote for the resolution at the UN
* Imposes "ban on all flights in Libyan airspace" except for aid planes
* Authorises member states to "take all necessary measures" to "protect civilians and civilian populated areas under threat of attack"
* Excludes occupation force
* Toughens arms embargo by calling on all member states to "inspect, in their territory, vessels and aircraft bound to or from Libya"
* Widens asset freeze to include Libyan Investment Authority, Central Bank of Libya and Libyan National Oil Company among others
A draft UN resolution tabled by the UK, France and Lebanon on Tuesday proposed a ban on all flights in Libya, authorised member states to enforce it and called on them to participate in it.
But on Thursday the US, which had been cool on the effectiveness of a no-fly zone, said the UN should go further and a new strongly-worded draft resolution was put forward calling for "all necessary measures short of an occupation force" to protect civilians under threat of attack.
Five countries out of 15 on the Security Council abstained from the vote, including Russia and China, who traditionally oppose military intervention in other countries.
BBC World