* Rebels clear western refinery of Gaddafi loyalists
* Rebels take Garyan, cut highway north to Tripoli
* Former French premier de Villepin held talks
(Adds de Villepin in talks with two sides, paragraphs 3-4)
By Ulf Laessing and Yvonne Bell
ZAWIYAH, Libya, Aug 18 Libyan rebels took control of an oil refinery in the western town of Zawiyah and blocked the main highway south of the capital on Thursday, further isolating Muammar Gaddafi's Tripoli stronghold.
Rebel advances in recent days have cut Gaddafi's forces off from their main international resupply routes following a months-long stalemate, putting the Libyan leader's 41-year rule under unprecedented pressure.
Confirming reports that, despite their denials, the rebels and Gaddafi loyalists are in negotiations, former French prime minister Dominique de Villepin told a French newspaper he was in the Tunisian town of Djerba on Monday to meet both sides.
"I was indeed there, but I cannot make any further comment because it would compromise the chances of success and the efficacy of these talks," he told Le Parisien. The talks had been "extremely difficult", he added.
The French government declined comment.
Rebel fighters occupied Zawiyah refinery, 50 km (30 miles) west of Tripoli on the highway linking the capital to Tunisia. A Reuters reporter at the plant saw no sign of Gaddafi's troops.
"The battle lasted for two days but the main battle was last night. We took control last night," said Saleh Omran, 31, a rebel fighter from Zawiyah. He said rebel forces fought about 150 Gaddafi troops, who finally fled by sea in inflatable boats.
Doctors at a hospital near Zawiyah said nine people were killed and at least 45 injured in fighting around the town and at the refinery on Wednesday, most of them rebels. A Grad rocket fired by Gaddafi forces had hit a house near the hospital.
ROAD SOUTH BLOCKED
Rebels also held the town of Garyan, about 80 km (50 miles) from Tripoli on the main highway south, a Reuters reporter said.
"We took one tank and an anti-aircraft gun from Gaddafi's forces. Next, we'll go to Tripoli," said a fighter called himself Mohammed. The captured weapons were in the town square.
Rebel forces advanced several kilometres north of Garyan later in the day, clashing with pro-Gaddafi fighters. Black smoke billowed from the direction of the fighting and gunfire and the explosions of rockets could be heard.
A spokesman for Gaddafi played down recent rebel gains and said the government remained in control of the country.
"This is a crisis that will last a few days and then it will be -- God willing -- overcome," said Moussa Ibrahim in remarks carried by JANA news agency on Thursday. "We will push ahead until we liberate the whole country."
Gaddafi's whereabouts are unknown.
Aided by NATO bombers, assault helicopters and a naval blockade, the rebels have transformed the battle in the last few days after many weeks of stalemate.
The United States deployed two more Predator surveillance drones, a U.S. official said on Wednesday.
On the eastern front, rebel forces said they had tightened their grip around the oil town of Brega, but had suffered high casualties in fighting over the past several days.
"All of Alargop is now free, liberated," spokesman Musa Mahmoud al-Mugrabi said of the area 6 km (4 miles) south of Brega, on a supply route for Gaddafi's forces running south.
"Casualties have been very high because it's urban clashes," he said. About 40 rebels have been killed and nearly 100 wounded in and around Brega over the past 10 days, according to a tally of reports from the rebels and hospital workers.
The 69-year-old Gaddafi seems isolated, with rebel forces closing in and vowing to enter Tripoli by the end of the month. A Reuters reporter in Tripoli, where military targets have been pounded by NATO warplanes for five months, said a few explosions were heard from the center of the city around midday.
Rebel forces said they were about 100 km (60 miles) west of the rebel-held port of Misrata on the road to Tripoli.
Zawiyah's refinery was one of the few sources of fuel for Gaddafi's troops and the people of Tripoli. Rebels said the plant was shut but showed no signs of serious damage as much of the fighting was with light weapons. A pipeline linking it to Tripoli was shut down on Tuesday, a rebel commander said.
Rebel fighters stripped posters of Gaddafi from a building inside the refinery complex and threw them to the ground.
Libyan Prime Minister Al-Baghdadi Ali Al-Mahmoudi denied the refinery was in rebel hands and called for a ceasefire.
"In terms of the military, we are indeed powerful enough to finish this battle to our advantage, but the cost would be too high," he told reporters in Tripoli. The Libyan government has said repeatedly it would welcome a ceasefire, on the condition it is preceded by a halt to NATO bombing.
(Additional reporting by Tom Miles in Geneva, Robert Birsel in Benghazi, Missy Ryan in Tripoli, Michael Georgy in the western Mountains, Hamid Ould Ahmed in Algiers, Souhail Karam in Rabat; Joseph Nasr in Berlin, Alexandra Sage in Paris; Ulf Laessing in Garyan; Writing by Richard Valdmanis; Editing by Douglas Hamilton and Alastair Macdonald)
Our top photos from the last 24 hours.