ZAWIYAH, Libya (Reuters) - Libyan rebels hoisted their flag in the center of this town near the capital on Sunday after the most dramatic advance in months cut offMuammar Gaddafi's capital from its main link to the outside world.
The swift rebel advance on the town of Zawiyah, about 50 km (30 miles) west of Tripoli, will deal a psychological blow to Gaddafi's supporters and also cuts the coastal highway toTunisia which keeps the capital supplied with food and fuel.
But there was no sign Tripoli was under immediate threat from a rebel attack: heavily armed pro-Gaddafi forces still lie between Zawiyah and the capital.
After their initial rapid advances were beaten back by Gaddafi's heavy armor, the Libyan rebels have largely been unable to break the stalemate, even with the help of NATO air strikes.
But rebel forces are now in their strongest position since the uprising against 41 years of Gaddafi's rule began in February. They now control the coast both east and west of Tripoli, to the north is the Mediterranean and a NATO naval blockade, while to the south is empty desert.
Rebels from the Western Mountains region south of this Mediterranean coastal town dashed forward into Zawiyah late on Saturday, encountering little sustained resistance from Gaddafi's forces.
Near Zawiyah's central produce market early on Sunday, about 50 rebel fighters were milling around and triumphantly shouting "Allahu Akbar!" or "God is greatest." The red, black and green rebel flag was flying from a shop.
Rebel fighters told Reuters there were still forces loyal to Libyan leader Muammar Gaddafi in the town, including snipers who they said had positioned themselves on tall buildings. Bursts of artillery and machine gun fire could be heard.
One rebel fighter said Gaddafi's forces were still in control of the oil refinery on the northern edge of Zawiyah -- a strategic target because it is the only one still functioning in western Libya and Gaddafi's forces depend on it for fuel.
Rebels said the capital was their next target once Zawiyah was fully under their control. One fighter smiled as he pointed to a road sign marking the highway from Zawiyah to Tripoli.
"I'm 1,000 percent sure we're going to take over Zawiyah today and then move on to Tripoli," said Bin Jaffin Ali, 34, a shopkeeper turned rebel fighter.
Further west along the coastal highway, near the main border crossing into Tunisia, local residents said late on Saturday there were heavy clashes between rebels and government troops but that Gaddafi's forces still controlled the crossing.
In Tripoli, government officials on Saturday denied Zawiyah was under rebel control, saying a small force of anti-Gaddafi fighters had launched a "suicide mission" that was quickly repelled.
Zawiyah is "absolutely under our control," government spokesman Moussa Ibrahimtold reporters. "A very small group of rebels tried to move into the south of Zawiyah but were stopped easily because of our armed forces," he said.
In the Tunisian capital, where many Libyans have fled from the fighting in their home country, Libyans came out on to the streets late on Saturday to celebrate after hearing unconfirmed rumors Gaddafi and his family had fled.
But there was no indication of any change in Tripoli. State television said Gaddafi's supporters were heading to his Bab al-Aziziyah compound to show their support.
In Brussels, the NATO alliance said it was monitoring what it called a "fluid" situation on the ground.
"Pro and anti-Gaddafi forces have been engaging each other. Nothing is certain yet and there is no confirmation about who has control of Zawiyah because the situation changes every day," a NATO official said.
BALANCE OF FORCES
Rebels, backed by NATO warplanes, have been trying since February to end Gaddafi's 41-year rule in the bloodiest of the "Arab Spring" uprisings convulsing the Middle East.
The conflict has been largely deadlocked, but the rebels' advance to the Mediterranean coast near Tripoli represents a major shift in the balance of forces.
Control of the highway to Tunisia could determine the outcome of the conflict because without it the capital is effectively besieged.
There was no traffic moving along the highway, and rebel fighters there said it was closed.
Gaddafi says the rebels are armed criminals and al Qaeda militants, and he has described the NATO campaign as an act of colonial aggression aimed at stealing Libya's oil.
Judging by impact craters, wrecked buildings and burned-out tanks, NATO warplanes had bombed government military targets on the route of the rebel advance to Zawiyah over the past week, providing close air support.
Zawiyah is the home town of many rebels battling on the western front and has staged two uprisings against Gaddafi since the revolt broke out against his rule.
Isa Korogle, a 35-year-old unemployed man, said he had been hiding in farmland near Zawiyah because he feared for his life since taking part in an uprising earlier this year.
"It feels like the first day of my life because I'm back in Zawiyah," he said on Sunday.
In the east, rebel forces clashed with Gaddafi's soldiers in the oil town of Brega but there were no reports of casualties on Sunday, a rebel spokesman and a hospital volunteer said.
"There are engagements but we're going slowly. This is our strategy because we want to avoid casualties," said Mohammad Zawawi, head of the rebels' media center in their stronghold of Benghazi, eastern Libya.
Sixteen rebels were killed and about 50 wounded over three days of clashes in Brega up to Sunday. At least six of Gaddafi's soldiers were also killed.
Brega is strung out along about 15 km (10 miles) of Mediterranean coast. The rebels have captured a residential neighborhood in the east while Gaddafi's troops still hold an oil terminal in the town's industrial sector in the west.
Setbacks for Gaddafi's forces near Tripoli were unlikely to undermine the morale of his troops in the east because they had no access to the news, Zawawi said.
"They don't let them use radio or television. They don't know anything about what's going on," he said. "Captured Gaddafi troops don't know anything."
(Additional reporting by Tarek Amara in Tunisia, Missy Ryan in Tripoli, Robert Birsel in Benghazi, Christopher Le Coq in Brussels and Hamid Ould Ahmed in Algiers; Writing by Christian Lowe; Editing by Jon Hemming and Louise Ireland)