As violence mounted, Gadhafi came under growing pressure from the international community to halt the crackdown on his people.
Echoing moves by the United States, Britain and other nations, the U.N. Security Council on Saturday imposed sanctions, including an arms embargo and a travel ban, and said the International Criminal Court in the Hague should investigate.
Residents of its eastern Tajoura district spread concrete blocks, large rocks and even chopped-down palm trees as makeshift barricades to prevent the SUVs filled with young men wielding automatic weapons from entering their neighborhood - a hotspot of previous protests.
With tensions running high in Tripoli, scores of people in the neighborhood turned out at a funeral for a 44-year-old man killed in clashes with pro-regime forces. Anwar Algadi was killed Friday, with the cause of death listed as "a live bullet to the head," according to his brother, Mohammed.
Armed men in green armbands, along with uniformed security forces check those trying to enter the district, where graffiti that says "Gadhafi, you Jew," "Down to the dog," and "Tajoura is free" was scrawled on walls.
Outside the capital, rebels held a long swath of about half of Libya's 1,000-mile (1,600-kilometer) Mediterranean coastline where most of the population lives, and even captured a brigadier general and a soldier Saturday as the Libyan army tried to retake an air base east of Tripoli. The state-run news agency also said the opposition held an air defense commander and several other officers.
On Friday, pro-Gadhafi militiamen - including snipers - fired on protesters trying to mount the first significant anti-government marches in days in Tripoli.
Gadhafi, speaking from the ramparts of a historic Tripoli fort, told supporters to prepare to defend the nation as he faced the biggest challenge to his 42-year rule.
"At the suitable time, we will open the arms depot so all Libyans and tribes become armed, so that Libya becomes red with fire," Gadhafi said.
The international community toughened its response to the bloodshed, while Americans and other foreigners were evacuated from the chaos roiling the North African nation.
In New York, the U.N. Security Council voted unanimously to slap sanctions on the Gadhafi regime. The council imposed an arms embargo and called on U.N. member states to freeze the assets of Gadhafi and his children. The council also imposed a travel ban on the Gadhafi family and 10 close associates.
Council members also agreed 15-0 to refer the regime's deadly crackdown to a permanent war crimes tribunal for an investigation of possible crimes against humanity.
The action came after U.N. Secretary-General Ban Ki-moon said some estimates indicate more than 1,000 people have been killed in less than two weeks since the protests broke out in Libya.
President Barack Obama said Gadhafi has lost his legitimacy to rule and must step down immediately. Obama, who made the comments Saturday to German Chancellor Angela Merkel, signed an executive order a day earlier that froze assets held by Gadhafi and four of his children in the United States.
In Tripoli, most residents stayed in their homes Saturday, terrified of bands of armed men at checkpoints and patrolling the city.
A 40-year-old business owner said he had seen Gadhafi supporters enter one of the regime's Revolutionary Committee headquarters Saturday and leave with arms. He said the regime is offering a car and money to any supporters bringing three people with them to join the effort.
"Someone from the old revolutionary committees will go with them so they'll be four," the witness said when reached by telephone from Cairo. "They'll arm them to drive around the city and terrorize people."
Other residents reported seeing trucks full of civilians with automatic rifles patrolling their neighborhoods. Many were young, even teenagers, and wore green arm bands or cloths on their heads to show their affiliation to the regime, residents said. All spoke on condition of anonymity for fear of reprisals.
Tripoli, home to about a third of Libya's population of 6 million, is the center of the eroding territory that Gadhafi still controls.
Even in the Gadhafi-held pocket of northwestern Libya around Tripoli, several cities have also fallen to the rebellion.
Militiamen and pro-Gadhafi troops were repelled when they launched attacks trying to take back opposition-held territory in Zawiya and Misrata in fighting that killed at least 30 people.
Gadhafi's son, Seif al-Islam, told foreign journalists invited by the government to Tripoli that there were no casualties in Tripoli and that the capital was "calm."
"Everything is peaceful," he said. "Peace is coming back to our country."
He said the regime wants negotiations with the opposition and said there were "two minor problems" in Misrata and Zawiya.
There, he said, "we are dealing with terrorist people," hut he hoped to reach a peaceful settlement with them.
Most shops in Tripoli were closed and long lines formed at bakeries as people ventured out for supplies.
In the Souq al-Jomaa neighborhood, piles of ashes stood in front of a burned-out police station. Graffiti on the walls read, "Down, down with Gadhafi." Elsewhere, shattered glass and rocks littered the streets.
A law school graduate walking to his house in the Fashloum area said he had seen many people killed by snipers in recent days.
"People are panicked, they are terrified. Few leave their houses. When it gets dark, you can't walk in the streets because anybody who walks is subject to be shot to death," he said.
He said Gadhafi's use of force against protesters had turned him against the regime.
"We Libyans cannot hear that there were other Libyans killed and remain silent," he said. "Now everything he says is a lie."
In Tripoli's Green Square, where state television has shown crowds of Gadhafi supporters in recent days, armed security men in blue uniforms were stationed around the plaza. Pro-Gadhafi billboards and posters were everywhere. A burned restaurant was the only sign of the unrest.
Supporters in about 50 cars covered with Gadhafi posters drove slowly around the square, waving green flags from the windows and honking horns. A camera crew filmed the procession.
Taxi driver Nasser Mohammed was among those who had a picture of Gadhafi and a green flag on his car.
"Have you heard the speech last night?" he asked. "It was great. Libyans don't want anyone but Gadhafi. He gave us loans."
Mohammed, 25, said each family will receive 500 Libyan dinars (about $400) after the start of the protests, plus the equivalent of about $100 credit for phone service. State TV said the distribution will take place starting Sunday.
Gadhafi loyalists manned a street barricade, turning away motorists trying to enter. After turning around, the drivers were then stopped at another checkpoint, manned by armed men in uniform, who searched cars and checked IDs of drivers and passengers.
In Misrata, a resident said the opposition was still in control of the city, which was calm Saturday, with many shops open and a local committee running civic affairs.
But the opposition only held parts of the sprawling Misrata Air Base after Friday's attack by Gadhafi supporters, he added.
The troops used tanks against the rebels at the base and succeeded in retaking part of it in battles with residents and army units who had joined the uprising against Gadhafi, said a doctor and a resident wounded in the battle on the edge of opposition-held Misrata, Libya's third-largest city, about 120 miles (200 kilometers) from the capital. The doctor said 25 people were killed in fighting at the base since Thursday.
The resident said pro-Gadhafi troops captured several members of the opposition Friday and now the two sides are talking about a possible swap since the opposition also captured a soldier and a brigadier general. Libyan state TV confirmed that army Brig. Gen.
Abu Bakr Ali was captured, although it said he was "kidnapped by terrorist gangs." The state-run news agency JANA also said regime opponents held the commander of the air defense's 2nd Division and several other officers.
State-run TV reported that the website of the JANA news agency was hacked.
A Libyan Islamist activist, Mokhtar al-Mahmoudi, was arrested in Tajoura on Thursday, according to his daughter Fatma al-Mahmoudi, who lives in Morocco. She said a neighbor also was arrested.
Al-Mahmoudi was arrested in 1998 over his ties with the Muslim Brotherhood and spent eight years in prison, she said.
The opposition also held complete control of Sabratha, a town west of Tripoli famed for nearby ancient Roman ruins, with no police or any security forces associated with the Gadhafi regime, said Khalid Ahmed, a resident. He added that tribes were trying to organize a march on Tripoli, although a checkpoint outside the capital would stop anyone from entering.
"All of Libya is together," Ahmed said. "We are not far from toppling the regime."
Thousands of evacuees from Libya reached ports Saturday across the Mediterranean, with many more still trying to flee the North African nation by sea, air or land.
More than 2,800 Chinese workers landed in Heraklion on the Greek island of Crete aboard a Greek ship Saturday, while another 2,200 Chinese arrived in Valletta, the capital of Malta, on a ship from the eastern Libyan port of Benghazi.
Thousands of expatriates streamed out of Libya at the bustling Tunisian border, most of them Egyptians and Tunisians.
More than 20,000 have arrived since early this week, said Heinke Veit of the European Union Humanitarian Aid group. Food, water and medical help is available, as are facilities to contact their families.