ALGIERS The difficulty Libyan forces had stamping out small numbers of rebels in the west of the country points to a long, hard and nasty fight when Muammar Gaddafi's troops reach the main rebel stronghold of Benghazi.
Another lesson from the fighting in the west is that an internationally enforced no-fly zone will do little to halt the advance of Gaddafi's forces because, at decisive moments, they have been beating the rebels on the ground, not from the air.
After losing control over large parts of his oil-exporting country last month to an uprising against his rule, Gaddafi has regained momentum. His forces have recovered two oil terminals in the east and are pushing on toward Benghazi.
U.S. National Intelligence Director James Clapper said last week that eventually, because of its military strength, "the regime will prevail".
The advance in the east has so far been relatively straightforward: Gaddafi's forces have been fighting in a bleak strip of desert coastline where they can use artillery and aircraft to scatter the disorganised rebel fighters.
But when they reach Benghazi, Gaddafi's superior firepower is likely to be blunted by the kind of urban warfare waged first in the city of Zawiyah, just to the west of Tripoli, and now in Misrata, 200 km (130 miles) east of the capital.
"Fighting in an urban environment is not only difficult but it is also confusing and confused," said Graham Cundy, a military specialist at Diligence, a Western security and intelligence consultancy.
"So it's not overly surprising it took so long to clear the urbanised areas," said Cundy, a former British military officer.
"The Libyan army is trained for force-on-force, it is not a particularly sophisticated military force in terms of command and control or its ability to communicate and it is also fighting a form of warfare it is not trained for nor used to."
In Zawiyah, despite encircling the town and having vastly more men and weapons, it took Gaddafi's forces two weeks of almost continuous fighting to finally root out the rebels from their base in the central square.
One rebel, who spoke by telephone before Zawiyah was finally captured on March 11, gave some clues as to how they were able to hold on as long as they did.
"When they (pro-Gaddafi forces) approach the square, we hide in specific places and when they enter we start attacking them from the sides, so we leave them no choice but to pull back," said the fighter, called Ibrahim.
"Also this is our town and we know it by heart and those who are entering it are not from Zawiyah so they do not know how to move around," he said.
These are some of the classic pitfalls of urban warfare, said Shashank Joshi, associate fellow at Britain's Royal United Services Institute.
"The urban backdrop affords a lot of opportunities for defensive firepower when you have a lot of forces coming in."
"So we saw homemade bombs dropped from rooftops, we saw fire coming in from fortified urban positions ... buildings, any sort of windows, immediately become points of great defensive advantage," Joshi said.
The flattened buildings reporters saw when the Libyan government took them to Zawiyah after the fighting indicated that, in the end, Gaddafi's forces got around the problems of urban warfare by using heavy artillery.
There are no reliable figures for how many residents were killed. But that tactic usually involves heavy civilian casualties -- something Gaddafi may seek to avoid in Benghazi if he hopes to govern the people there afterwards.
In Misrata, the fight to crush the rebels has not yet begun in earnest, but signs are emerging there of a different problem Gaddafi's forces could encounter as they move east: desertions.
Government officials in Tripoli dismiss it as "rubbish" but rebels in the city say some security force members defected when they were ordered to attack, and that there have been gunfights as loyal forces try to put down a mutiny.
"You may well see further layers (of the security forces) peel off," said Joshi.
Even in their relatively unimpeded advance in the east toward Benghazi, Gaddafi's forces have not shown great military sophistication.
Their tactics appear to be to bomb rebel positions from warplanes, gunboats and tanks, wait for the rebels to scatter, move in a limited number of ground troops who are shown on state television, and then withdraw to fortified positions.
At night, the bombardment usually slows, allowing the rebels to creep back toward Gaddafi's lines, remain in place overnight, and scatter again when bombardment renews during the day.
Some rebel fights use the Arabic term "kar wa far" -- roughly translated as "back and forth" -- to describe the pattern of the fighting.
After urgent appeals from rebel leaders, some governments are seeking a United Nations Security Council ruling on imposing a no-fly zone over Libya so Gaddafi cannot use his warplanes against the rebels.
But precedent shows no-fly zones do not always prevent ruthless leaders using weapons against their own people.
"When you had a no-fly zone in Iraq, its value as a military tool I think was pretty limited," said Cundy, the ex-British military officer. "He (former Iraqi leader Saddam Hussein) just worked around it very effectively."
(Additional reporting by Alexander Dziadosz in Tobruk, Libya and Mariam Karouny in Tunis; Editing by Giles Elgood)