By Mohammed Abbas
AJDABIYAH, Libya (Reuters) - Muammar Gaddafi's forces captured part of a town in western Libya on Friday, but rebels said they had taken the coastal oil town of Ras Lanuf, extending the territory they control in the east of the country.
The fighting appeared to confirm the division of the oil-producing desert state into 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 a hotel roof to fire at protesters marching through town after Friday prayers to demand Gaddafi's resignation, Mohamed said.
Rebel fighters retreated but were still holding the central Martyrs Square later in the day, a rebel spokesman said.
A Libyan government official said the town had fallen. "It's been liberated, maybe there are still some pockets (under rebel control) but otherwise it's been liberated."
In the east, rebels said they had captured the airport of Ras Lanuf and later that they had taken the oil town itself, which lies on a strategic coast road 660 km (410 miles) from Tripoli.
"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 military base and oil terminal.
A deputy foreign minister in Tripoli disputed this, telling 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.
The revolt 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 veteran presidents of both Tunisia and Egypt -- Libya's western and eastern neighbors.
A rebel spokesman said pro-Gaddafi forces bombed an arms depot -- one of the biggest weapons stores 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 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 kilometres away, residents said.
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 the revolt had halted one million barrels per day (bpd) of Libya's 1.6 million bpd oil output. The loss, due largely to the flight of thousands of foreign oil workers, is a big blow to the economy.
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, after attacks on civilians that have provoked international condemnation, arms and economic sanctions and a war crimes investigation.
"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. Al Jazeera said up to 100 people were arrested, accused of helping the rebels.
A pro-Gaddafi rally in Tripoli's central Green Square later drew several hundred demonstrators, many waving green flags.
Earlier on Friday, rebel volunteers said a rocket attack by a government warplane just missed a rebel-held military base that 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)