Forces loyal to Muammar Gaddafi fired a Scud missile for the first time in Libya's civil war, a U.S. defense official said, after rebel advances left the Libyan leader isolated in his capital.

Rebels fighting to end Gaddafi's 41-year rule seized two strategic towns near Tripoli over the past two days, cutting the city off from its supply lines and leaving the Libyan leader with a dwindling set of options if he is to stay in power.

However, pro-Gaddafi forces were encountering a fight-back in one of those towns, Zawiyah, west of Tripoli. Snipers concealed in tall buildings were picking off rebel fighters, and salvos of Russian-made Grad rockets landed in the town.

The Scud missile was fired on Sunday morning from near Sirte, Gaddafi's home town 500 km (310.7 miles) east of Tripoli, and landed further east between the rebel-held towns of Brega and Ajdabiyah, said the U.S. official.

The missile came down in the desert, injuring no one, said the official, who was speaking on condition of anonymity. There was no immediate comment from the government in Tripoli.

Firing the missile, which poses little military threat because it is so inaccurate, is evidence of the Gaddafi administration's desperation, said Shashank Joshi, Associate Fellow at Britain's Royal United Services Institute.

"It's an obvious sign that the regime's back is to the wall," he said.

In the six months of fighting up to now, Gaddafi's forces have used short-range Grad rockets but have not before deployed Scud missiles, which have a range of about 185 miles.

In the rebel headquarters in the eastern city of Benghazi, officials said the Scud was probably intended to hit rebel forces near Ajdabiyah.

"Gaddafi troops are using his last gun. He's crazy," said Mohammad Zawawi, media director for rebel forces. "We're scared he'll use chemicals. That's why we're trying to end this war and we hope to end it with the least number of casualties."

"We can't prevent the scuds but we hope NATO can. NATO has the technology to detect them."

Analysts say the rebel strategy is to isolate Tripoli and hope the government collapses, but they say it is also possible Gaddafi will opt to stage a last-ditch fight for the capital.

In a barely audible telephone call to state television in the early hours of Monday, Gaddafi called on his followers to liberate Libya from rebels and their NATO supporters.

"Get ready for the fight ... The blood of martyrs is fuel for the battlefield," he said.

REBEL PUSH

He was speaking as rebels made their most dramatic advances in months of fighting, shifting the momentum in a conflict that had been largely static and was testing the patience of NATO powers anxious for a swift outcome.

Rebel forces in the Western Mountains south of Tripoli surged forward at the weekend to enter Zawiyah. The town is about 50 km (30 miles) west of Tripoli and, crucially, straddles the main highway linking the capital to Tunisia.

A day later, rebels said they had captured the town of Garyan, which controls the highway south from Tripoli linking it to Sabha, a Gaddafi stronghold deep in the desert.

"Gaddafi has been isolated. He has been cut off from the outside world," a rebel spokesman from the Western Mountains, called Abdulrahman, told Reuters by telephone.

Tripoli officials deny the rebels control Zawiyah, and say their forces are preparing to drive "armed gangs" from Garyan.

Rebels on the outskirts of Zawiyah said most of Gaddafi's forces had pulled out of the town, but left behind snipers who made it dangerous for the anti-Gaddafi fighters to move around.

A Reuters reporter saw a rebel pick-up truck deliver six government troops to a makeshift prison. Each of the prisoners was blindfolded with green fabric. They were made to kneel facing a wall and several rebels walked by, shouting at them and slapping them on the head.

"They were firing at us," said Abdel-Muiz Ramadan, 20, a rebel fighter. "We captured one of them and he gave us the location of the others."

He said the snipers were concentrated in tall buildings around Martyrs' Square, focus of a failed revolt by Zawiyah residents earlier this year. "Every time we approach the area, one of their snipers fires at us," said Ramadan.

Medical workers at one of the town's hospitals said 20 people, a mixture of rebel fighters and civilians, were killed on Monday, and the death toll for Tuesday had reached one.

PEACE TALKS

A U.N. envoy arrived in neighboring Tunisia, where sources say rebels and representatives of the government have been holed up on the island resort of Djerba for negotiations.

Tunisia's official news agency on Tuesday quoted the envoy, Abdel Elah al-Khatib, as saying he knew nothing of any negotiations in Djerba.

Speaking in Tunis, he said he held informal talks with representatives of Gaddafi's government and the rebel council. The envoy did not say who they were or what they discussed.

Gaddafi's spokesman denied Tripoli was in talks about the leader's departure, saying reports of such negotiations were the product of a "media war" being waged against Libya.

Talks could signal the endgame of a civil war that has drawn in the NATO alliance and emerged as one of the bloodiest confrontations in the wave of unrest sweeping the Arab world.

Rebels may still lack the manpower for an all-out assault on Tripoli, but are hoping their encirclement of the capital will bring down Gaddafi's government or inspire an uprising. In the past, however, they have frequently failed to hold gains, and a fightback by Gaddafi troops could yet force them back.

Pro-Gaddafi residents of the capital remain defiant.

Makhjoub Muftah, a school teacher who has signed up as a gun-toting pro-Gaddafi volunteer, like many others seemed to think a rebel advance into Tripoli was a remote possibility.

"I wish they would march into Tripoli. I wish," he said, daring the rebels. "They will all die."