But rebels made new gains, seizing a military air base, as Gaddafi blamed Osama bin Laden for the upheaval.
The worse bloodshed was in Zawiya, 50 kilometers west of the capital Tripoli.
An army unit loyal to Gaddafi opened fire with automatic weapons on a mosque where residents — some armed with hunting rifles for protection — have been holding a sit-in to support protesters in the capital, a witness said.
The troops blasted the mosque’s minaret with an anti-aircraft gun. A doctor at a field clinic set up at the mosque said he saw the bodies of 10 dead, shot in the head and chest, as well as around 150 wounded. A Libyan news website, Qureyna, put the death toll at 23 and said many of the wounded could not reach hospitals because of shooting by “security forces and mercenaries”.
A day earlier, an envoy from Gaddafi had come to the city from Tripoli and warned the protesters: “Either leave or you will see a massacre,” the witness said. On Tuesday night, Gaddafi himself called on his supporters to hunt down opponents in their homes.
Zawiya, a key city close to an oil port and refineries, is the nearest population center to Tripoli to fall into the hands of the anti-Gaddafi rebellion that began on Februrary 15. Hundreds have died in the unrest.
Most of the eastern half of Libya has already broken away, and diplomats, ministers and even a high-ranking cousin have abandoned Gaddafi, who has ruled Libya for 41 years. He is still believed to be firmly in control only of the capital, some towns around it, the far desert south and parts of Libya’s sparsely populated center.
Gaddafi’s crackdown has been the harshest by any Arab leader in the wave of protests that has swept the Middle East the past month, toppling the presidents of Libya’s neighbours — Egypt and Tunisia.
The New York-based Human Rights Watch has put the death toll in Libya at nearly 300, according to a partial count. Italy’s Foreign Minister Franco Frattini said estimates of some 1,000 people killed were “credible”.
The upheaval in the OPEC nation has taken most of Libya’s oil production of 1.6 million barrels a day off the market, and crude prices have jumped 20% to two-year highs in just a week reaching $99.77 per barrel in afternoon trading in New York and $114.20 in London on Thursday. Most of the oil goes to Europe.
Hours after the attack in Zawiya, Gaddafi called in to state TV and in a rambling speech expressed condolences for the dead but then angrily scolded the city’s residents for siding with the uprising.
He blamed the revolt on bin Laden and teenagers hopped up on hallucinogenic pills given to them “in their coffee with milk, like Nescafe”.
“Shame on you, people of Zawiya, control your children,” he said, addressing residents of the city outside Tripoli where the mosque attack took place.
“They are loyal to bin Laden,” he said of those involved in the uprising.
“What do you have to do with bin Laden, people of Zawiya? They are exploiting young people. I insist it is bin Laden.”
Gaddafi quickly condemned the September 11 attacks that bin Laden masterminded, saying: “We have never seen such a horrific and terrifying act performed in such a exhibitionist manner.”
He cracked down on his country’s Muslim militants, including those linked to al-Qaida. But in 2009, he said bin Laden had shown signs that he is open to dialogue and recommended President Barack Obama seek an opening with the terrorist leader.
Thousands massed in Zawiya’s main Martyrs Square by the Souq Mosque after the attack, shouting for Gaddafi to “leave, leave,” a witness said.
“People came to send a clear message: We are not afraid of death or your bullets,” he said.
In the latest blow to the Libyan leader, a cousin who is one of his closest aides, Ahmed Gadhaf al-Dam, announced that he has defected to Egypt in protest against the regime’s bloody crackdown, denouncing what he called “grave violations to human rights”.
Gadhaf al-Dam is one of the highest level defections to hit the regime so far, after many ambassadors around the world, the justice minister and the interior minister all sided with the protesters. Gadhaf al-Dam belonged to Gaddafi’s inner circle, served as his liaison with Egypt and frequently appeared by his side.
The regime’s other attempt to take back lost territory came east of Tripoli. Pro-Gaddafi militiamen — a mix of Libyans and foreign mercenaries — assaulted a small airport outside Libya’s third largest city, Misrata, about 120 miles (200 kilometers) from the capital.
Militiamen with rocket-propelled grenades and mortars barraged a line of government opponents who were guarding the airport, some armed with rifles, said one of the rebels who was involved in the battle.
During the fighting, the airport’s defenders seized an anti-aircraft gun used by the militias and turned it against them, he said.
Gaddafi’s crackdown has so far helped him maintain control of Tripoli.
But the uprising has divided the country and raised the spectre of civil war.