The UN Security Council cleared the way for air strikes to halt Moamer Kadhafi's assault on embattled rebels in Libya, sparking wild celebratory gunfire in rebel bastion Benghazi.
The 15-member Security Council in a resolution approved "all necessary measures" to impose a no-fly zone, protect civilian areas and pressure the Libyan leader into accepting a ceasefire.
The UN vote passed 10-0 with five abstentions -- permanent members China and Russia which did not wield their veto power -- plus Germany, Brazil and India.
No German troops will take part in any military intervention in Libya as there are "considerable risks and dangers", Foreign Minister Guido Westerwelle said afterwards.
"We remain eminently sceptical on the option of military intervention... anticipated in this resolution. We see in it considerable risks and dangers. That is why we could not approve this part of the text," a statement said.
"German soldiers will not take part in a military intervention in Libya."
Diplomats indicated air strikes from a coalition led by Britain, France and the United States could be imminent, just hours after Kadhafi had threatened to send his troops against Benghazi.
Kadhafi later changed tack as "a humanitarian gesture" and decided to hold off on plans to mercilessly crush all resistance, CNN reported.
"I just took a phone call from one of Kadhafi's sons, Seif (al-Islam). This is the message from the leadership," the CNN correspondent in Tripoli said.
"He said they're going to change the tactics around Benghazi, that the army is not going to go into Benghazi. It's going to take up positions around the stronghold. The reason is they expect a humanitarian exodus."
Libya, despite condemning the resolution as a threat to its unity, said it was ready for a ceasefire but wanted to discuss terms of its implementation, Deputy Foreign Minister Khaled Kaaim told reporters.
He indicated Libya would "react positively to the UN resolution, and we will prove this willingness while guaranteeing protection to civilians."
US President Barack Obama called French President Nicolas Sarkozy and Britain's Prime Minister David Cameron Thursday to coordinate Libya strategy.
"The leaders agreed that Libya must immediately comply with all terms of the resolution and that violence against the civilian population of Libya must cease," the White House said in a statement.
The European Union welcomed the UN resolution and the head of the European Parliament, Poland's Jerzy Buzek, said "there was no time to waste" to enforce it.
Canadian media also reported plans to send six warplanes to help enforce the no-fly zone.
In Rome, Italian Prime Minister Silvio Berlusconi met defence officials to discuss the UN decision, ANSA news agency said. It also quoted Kaaim in Tripoli as saying: "Let's hope Italy keeps out of this initiative."
Italy -- Libya's former colonial ruler -- has been diplomatically cautious so far but has voted in favour of sanctions against Kadhafi's regime.
In Benghazi in the east, Libya's second city and stronghold of the month-long rebellion against Kadhafi's iron-fisted four-decade rule, celebratory gunfire rang out moments after the UN vote.
Preachers in mosques in the Mediterranean city used loudspeakers to shout "God is greatest, God is greatest."
Tracer bullets streaked across the night sky and anti-aircraft fire punctuated the sound of car horns.
Kadhafi, in a televised address, had warned just hours before the vote that his forces would attack Benghazi on Thursday night and show "no mercy."
"We will chase the traitors from Benghazi," he told his troops. "Destroy their fortifications. Show them no mercy. The world needs to see Benghazi free."
The rebel command in Benghazi ordered its fighters to man artillery posts and missile batteries after Kadhafi's announcement, rebel radio reported.
Kadhafi spoke shortly after his defence ministry said "any military operation against Libya will expose all air and maritime traffic in the Mediterranean to danger."
"Any civilian or military moving traffic will be the target of a Libyan counter-offensive," the official Jana news agency quoted the defence ministry spokesman as saying.
Qatar and the United Arab Emirates could be among the Arab nations to join any coalition that takes action against Kadhafi's regime, the Arab League's UN representative said.
Before the vote, protesters in Benghazi said they would welcome air strikes and an internationally enforced no-fly zone.
"The Libyan people want a no-fly zone, we want them to target Kadhafi's forces, his positions, but we don't want any troops on our land, we don't want to be like Iraq," said Mustafa Safez.
"We will win this war, and we are not afraid of him any more."
Insurgents on Thursday claimed they had shot down warplanes trying to bomb Benghazi and disputed claims of territorial gains by Kadhafi forces.
State television had said the regime loyalists were on the outskirts of Benghazi.
Allibya television said "the town of Zuwaytinah is under control (of loyalists) and armed forces are on the outskirts of Benghazi."
A rebel spokesman told AFP by telephone: "The Kadhafi forces tried to carry out an air raid on the city but our anti-aircraft defences repulsed the offensive and two planes were shot down."
Libyan television also said loyalists had overrun the rebel bastion of Misrata, 200 kilometres (125 miles) east of Tripoli, but that was denied by the rebels.
"We still control the city, even its outskirts. Kadhafi is mobilising his forces a few kilometres away," the spokesman said by telephone.
He said 18 people, including three civilians, were "martyred" on Wednesday and that "we inflicted huge losses to the Kadhafi forces, including 60 people killed."
A witness in the western town of Zintan said rebels there were bracing for an attack.
As uncertainty reigned on Thursday, aid agencies on Egypt's border with Libya braced for an onslaught of refugees if Kadhafi prevailed.
"If Benghazi is taken, we are expecting 40,000 to 100,000 people, and we are not ready," said Andrea Oess, of Swiss Humanitarian Aid.