By Mohammed Abbas
AJDABIYAH, Libya (Reuters) - Muammar Gaddafi's forces fought their way into a rebel-held western town on Friday, but rebels said they had captured the eastern oil town of Ras Lanuf, extending their hold on eastern Libya.
The fighting appeared to confirm the division of the vast desert oil-producing state between a western area round the capital Tripoli held by forces loyal to Gaddafi and an eastern region held by those rebelling against his four-decade rule.
In Zawiyah, a town 50 km (30 miles) west of Tripoli whose control by the rebels had embarrassed the government, "dozens were killed and more were wounded," by pro-Gaddafi forces, said Mohamed, a resident. "We have counted 30 dead civilians."
The loyalist forces used grenade-launchers, heavy machineguns and snipers on the roof of a new hotel to fire at protesters when they marched after Friday prayers to demand the fall of the regime, Mohamed said.
An improvised rebel force had withdrawn to the central Martyrs Square, and government troops were 4-5 kilometers away, a rebel spokesman said.
A Libyan government official said of the town: "It's been liberated, maybe there are still some pockets (under rebel control) but otherwise it's been liberated."
In the east, rebels said their forces had taken the oil town of Ras Lanuf, which lies on a strategic coastal road, hours after saying they had captured the town's airport.
"We have taken Ras Lanuf 100 percent, Gaddafi's forces have all left," rebel soldier Hafez Ibrahim said from the town. He did not say who controlled the nearby military base and oil terminal.
A deputy foreign minister in Tripoli, however, told reporters that government forces still held the town.
Rebels have already seized control of much of the rest of eastern Libya, the main oil-producing part of the country, in a popular uprising centered on Benghazi, Libya's second city.
A rebel spokesman said pro-Gaddafi forces bombed an arms depot -- one of the biggest weapons depots in the region -- on the outskirts of Benghazi on Friday.
"A lot of people have been killed. There are many people in the hospital. No one can approach, it's still very dangerous," said a resident who would only identify himself as Saleh.
Security forces had cordoned off the area, and a Reuters witness said at least eight ambulances were seen ferrying casualties from the scene. Windows were shattered in suburbs several kilometers from the scene, residents said.
The uprising against Gaddafi is the bloodiest yet against a long-serving ruler in the Arab world, and follows the ousting in the past weeks of the long-time presidents of both Tunisia and Egypt -- Libya's western and eastern neighbors.
The cut in Libya's 1.6 million barrel per day oil output -- caused partly by the flight of thousands of key foreign oil workers -- is a major blow to its economy.
News of the fighting pushed up U.S. crude prices to their highest levels since September 2008, and Brent crude futures for April delivery rose $1.36 to $116.17 a barrel.
The International Energy Agency said one million barrels per day (bpd) of Libya's oil output was shut, the top of the range it had estimated on Wednesday.
The upheaval has caused a humanitarian emergency on the Tunisian border where tens of thousands of foreign workers have fled to safety. An international airlift is under way, reducing the number of refugees stranded in tented camps.
The rebels earlier told Reuters they were open to talks only about Gaddafi's exile or resignation, following attacks on civilians that have provoked international condemnation, arms and economic sanctions and a war crimes probe.
"Victory or death ... We will not stop until we liberate all this country," Mustafa Abdel Jalil, head of the rebel National Libyan Council told supporters of the two-week-old uprising.
Western nations have called on Gaddafi to go and are considering various options including the imposition of a no-fly zone, but are wary about any offensive military involvement.
In Tripoli, shooting rang out across Tajoura district as Gaddafi loyalists broke up a crowd of protesters seeking an end to his long rule and shouting "Gaddafi is the enemy of God!"
The demonstrators spilled out of the Murat Adha mosque after Friday prayers, and several hundred began chanting for an end to Gaddafi's four decades in power.
Up to 100 people in Tripoli had been arrested, accused of helping the rebels, Al Jazeera said.
Earlier on Friday, rebel volunteers said a rocket attack by a government warplane just missed a rebel-held military base which houses an arsenal in the eastern town of Ajdabiyah.
(Additional reporting by Maria Golovnina, Michael Georgy, Yvonne Bell and Chris Helgren in Tripoli, Tom Pfeiffer and Alexander Dziadosz in Benghazi, Souhail Karam and Marie-Louise Gumuchian in Rabat, Yannis Behrakis and Douglas Hamilton on Tunisia border; Christian Lowe and Hamid Ould Ahmed in Algiers; Writing by Tim Pearce; editing by Myra MacDonald)