Libya’s military has leveraged its overwhelming advantage in firepower to rout rebel forces in recent days, turning the tide of a conflict in which the rebels once seemed to have had at least a fighting chance.

Moammar Gaddafi leads the worst-trained, worst-maintained military in North Africa, but his decrepit armed forces have consolidated control around Tripoli, the capital, and steadily reclaimed several cities and coastal territory that had temporarily fallen into the opposition’s hands.

Absent foreign intervention, officials and analysts say, leaders of the uprising will be forced to retreat completely to their base in the eastern city of Benghazi and adopt guerrilla tactics more in keeping with a classic insurgency.

“The rebels simply don’t have the expertise or equipment to hold territory,” said Fred Wehrey, a Rand Corp. security analyst and reserve officer in the U.S. Air Force, who was in Libya on assignment until last month. “Their best case may be to withdraw into terrain that’s better suited to a lightly equipped rebel force where they could try to simply bleed the regime dry.”

Unlike deposed rulers Hosni Mubarak of Egypt and Zine el-Abidine Ben Ali of Tunisia, Gaddafi has survived a popular revolt because he has largely retained the loyalty of his armed forces. They have been willing to brutalize and kill civilians, a line that the Egyptian and Tunisian militaries would not cross.

A similar dynamic is likely to shape the outcome of other Arab uprisings as autocrats across the Middle East quickly reassess whether they can count on their security forces to keep them in power. In Bahrain — where the ruling Khalifa family has long staffed the army with fellow Sunni Muslims from Pakistan to keep the kingdom’s majority Shiite population in check — an estimated 2,000 troops from Saudi Arabia and the United Arab Emirates have been brought in to maintain control.

Gaddafi’s inner circle

In Libya, Gaddafi has outlasted an initial wave of troop defections by leaning on an inner circle of family members and trusted aides. He has also relied on fighters from other African countries to help quash the rebellion.

Responsibility for protecting the Libyan leader and Tripoli rests with his son Khamis, the Russian-trained leader of the 32nd Brigade, the best-equipped military unit in Libya . U.S. officials said the 32nd Brigade has led the crackdown in the capital and has recaptured or besieged nearby cities on the Mediterranean coast, such as Zawiyah and Misurata.

A different brigade, thought to be led by another of Gaddafi’s sons, Saadi, has moved eastward toward the rebel stronghold of Benghazi. Yet another son, Mutassim, serves as Libya’s national security adviser. A brother-in-law, Abdullah al-Senussi, is the longtime head of military intelligence.

“These people know that if [Gaddafi] goes down, they’ll go down with him,” said Chuck Cecil, a retired State Department official who served as the top U.S. diplomat in Libya from 2006 to 2007. “There’s going to be a lot of retribution. So for them, it’s a fight to preserve their own lives.”

Ill-trained military

Precise details of Libya’s military power are murky, but the London-based International Institute for Strategic Studies recently estimated that Gaddafi had 119,000 military personnel at his disposal, including 45,000 reservists, before the rebellion. Those forces include 10 tank battalions with an estimated 2,000 tanks, 28 infantry battalions and seven air defense battalions.

Analysts, however, have characterized the Libyan military as poorly trained and its equipment — much of it bought from the Soviet Union in the 1970s and 1980s — as being in bad condition because of international sanctions. Many of its tanks and aircraft have been disabled or kept in storage because of a lack of qualified troops and pilots.

“Its overall ratio of weapons to manpower is militarily absurd, and Libya has compounded its problems by buying a wide diversity of equipment types that make it all but impossible to create an effective training and support base,” concluded Anthony H. Cordesman and Aram Nerguizian of the Washington-based Center for Strategic and International Studies in a December study .

On-the-ground advantage

Rebel leaders have accused Gaddafi of ordering airstrikes against civilians and have called on the United States and NATO to impose a “no-fly” zone over Libya. On Saturday, the Arab League also endorsed such a plan.

U.S. officials and analysts, however, have said that Gaddafi’s air units have played a limited role in the conflict. Most of his planes are grounded, they said, and those that can fly rely on outdated technology.

Instead, Gaddafi’s forces have used artillery and tanks, mostly T-72 Soviet-built models, to pound rebel-held cities. In recent days, several mechanized infantry units have moved quickly into eastern Libya.

“Psychologically, air power is very impressive, but what you really need to take back territory are forces on the ground,” said Alexander von Rosenbach, armed forces editor for Jane’s, the British security and defense research firm.

Rebel forces seized control of several arms depots in the eastern part of the country, including large ones near Benghazi and Ajdabiya that are well stocked with mortar shells, rocket-propelled grenades and machine guns, said Gary Li, a military analyst with the International Institute for Strategic Studies.

The rebels also appear to have stocks of Grad truck-mounted multiple-rocket launchers but have not made much use of them because of a lack of training, Li said. Rebel forces are commanded by professional Libyan military officers who defected, but in general their ragtag units are loosely organized.

As Gaddafi’s forces push closer to Benghazi — which is 630 miles east of the capital — their biggest challenge might be the risk of spreading themselves too thin. Analysts said that it could be difficult for the military to maintain adequate supply lines and fuel reserves and that rebel sabotage would probably emerge as a threat.

“They’re barely able to keep a lid on Tripoli,” Li said. “We don’t really know how many resources they have left.”