RAS LANUF, Libya  Forces loyal to the Libyan leader, Col. Muammar el-Qaddafi, attacked rebel fighters Wednesday on the outskirts of this strategic refinery town, provoking a response that included the firing of missile fusillades and rocket-propelled grenades. It was perhaps the fiercest engagement yet between the budding opposition army and the government during the three-week-old conflict.

Backed by their heavy weaponry, the rebels managed to advance on foot for a few miles to the west, witnesses said, until the fighters were frozen by fire from government mortars and heavy machine guns and forced to retreat in trucks. At least five rebels died in the fighting.

In the western half of the country, elite government troops continued to pound the besieged rebel-held city of Zawiyah, only 30 miles from Tripoli, the capital and Colonel Qaddafi’s stronghold.