Updated

Libyan rebels battling Muammar al-Qaddafi's troops along the country's Mediterranean coast said they captured a key oil terminal Thursday after three weeks of hand-to-hand fighting.

Rebel spokesman Mohammed al-Rijali said he was with the fighters in Brega when they gained control of the strategic port city, 125 miles southwest of the de-facto rebel capital of Benghazi.

"Brega is liberated," al-Rijali told The Associated Press after nightfall.

Al-Rijali, who spoke over the telephone from nearby Ajdabiya, didn't provide any details or a casualty toll. His claim could not be immediately verified. Officials in the Libyan capital Tripoli made no comment on the rebel claim.

Brega fell under rebel control briefly in March, but was recaptured by Qaddafi's forces shortly afterward. The fighting around the city has gone back and forth since then, with the rebels not managing to keep their ground.

Brega's capture would be an important boost for the rebels because whoever controls the strategic oil terminal, which is also Libya's second-largest hydrocarbon complex, is in charge of the country's main oil fields.

Another rebel spokesman, Mohammed al-Zawawi, said earlier Thursday that two rebels died in the day's fighting in Brega, while 16 others were wounded.

Libya's 6-month old civil war has been deadlocked for months despite NATO's airstrikes to protect civilians.

The revolt began in mid-February, with the rebels quickly wresting control of much of the eastern half of the country, as well as pockets in the west.

But the conflict later settled into a stalemate with the rebels failing to budge the front lines in the east since April, and making only minor gains from the pockets they control in the western Nafusa mountains and the port city of Misrata. Qaddafi, meanwhile, continues to control the rest of the west from his stronghold in Tripoli.

In recent weeks, rebels have pushed out of their Nafusa strongholds, advancing on the coastal plain toward Qaddafi-held towns along the Mediterranean. The rebels hope to first capture towns near Tripoli, before launching an offensive on the capital, commanders have said.

Meanwhile, rebel fighters and Qaddafi troops exchanged fire on the country's western front Thursday along a highway leading to the coastal town of Zawiya, said rebel fighter Mohammed Frefer.

The fighting took place in Nasser City, a town about 16 miles south of Zawiya -- the closest rebels have come to Tripoli, just 30 miles to the east. Rebel fighters had reached Nasser City on Wednesday, but pulled back a few miles after encountering strong resistance.

Frefer, returning from the front line with a slight arm injury, said Qaddafi's troops fired rockets at rebel positions around Nasser City on Thursday.

Two rebel fighters were killed and one wounded, said Mohammed Salem, a hospital medic in Zintan, a rebel-held town south of the front line.

Capturing both Brega or Zawiya would mark a significant gain in the Libyan rebels' goal to topple the Qaddafi regime.

"It will be a huge morale victory," said Fawzi Bukatef, a Brega rebel operations chief and head of the Coalition of Revolutionaries -- a large group of armed Libyan volunteers and civilians who fight at the front lines.