Troops loyal to the Libyan leader, Muammar Gaddafi, have retaken Brega, forcing rebel fighters into a chaotic retreat under a barrage of tank and artillery fire to the town of Ajdabiya.

With Gaddafi's forces advancing on Ajdabiya, rebels are fleeing back to the position they held before Nato air strikes began, on Saturday.

Nato planes continued to bombard the regime troops, but their outgunned opponents were forced back from positions taken earlier in the week, when they advanced to within 60 miles of Sirte, Gaddafi's home city.

Meanwhile, as debate within the anti-Gaddafi international coalition over the legality of arming the rebellion continued, the foreign secretary, William Hague, said it would be possible to supply weapons under certain circumstances.

Earlier, David Cameron told the Commons no decision had been made but he "would not necessarily rule out the protection of civilians in certain circumstances".

The rebels' rapid withdrawal came just days after they raced westwards following the destruction of government tanks and artillery in five days of aerial bombardment in Ajdabiya.

Ragtag opposition fighters have repeatedly been forced to retreat after fierce bombardments by the more disciplined government troops.

"Gaddafi hit us with huge rockets. He has entered Ras Lanuf," one rebel fighter, Faraj Muftah, told Reuters after pulling out of the oil port.

"We were at the western gate in Ras Lanuf and we were bombarded," said a second fighter, Hisham.

Speaking to the Commons, Hague revealed that five Libyan diplomats had been expelled from the regime's London embassy because they represented a potential security risk.

Hague said that while the current arms embargo prevented weapons being provided to the whole of Libya, UN resolution 1973 allowed "for all necessary measures to protect civilians" to be taken.

The British government's view, which was not necessarily shared internationally, was that this meant rebels protecting civilians could be armed, although ministers had "not yet taken a decision", he said.

There also remain questions about who is represented in the interim national council (INC) guiding the uprising.

In Washington, Admiral James Stavridis, Nato's supreme allied commander in Europe, told the Senate intelligence reports had suggested "flickers" of al-Qaida or Hezbollah presence within the rebel movement.

A UK diplomat, Christopher Prentice, the ambassador in Rome, met rebel leaders in their stronghold of Benghazi on Monday and Tuesday, the Foreign Office said.

Cameron told the Commons during prime minister's questions: "In terms of the situation on the ground, it is an extremely fluid situation, but there is no doubt in anyone's mind that the ceasefire is still being breached and it is absolutely right for us to keep up our pressure under UN security council resolution 1973."

Asked by the Labour leader, Ed Miliband, whether the terms of the resolution that authorised "all necessary measures" to protect Libyan civilians, overrode the arms embargo, Cameron said: "I have said before in the house that we must do everything to comply with both the security council resolutions.

"The arms embargo applies to the whole of the territory of Libya, but at the same time UN security council resolution 1973 allows all necessary measures to protect civilians and civilian-populated areas.

"Our view is that this would not necessarily rule out the provision of assistance to those protecting civilians in certain circumstances. We do not rule it out but we have not taken the decision to do so."

Cameron said coalition forces had "taken action yesterday against regime forces harassing civilian vessels trying to get into Misrata", the rebel-held town in the west of Libya, under siege from Gaddafi's troops for several days. The RAF had flown 24 sorties over Libya on Tuesday night and Wednesday.

He also revealed that in his talks with the INC's special envoy at Tuesday's international conference on the Libya crisis he had been "reassured" the group wanted its role to be transitional.

"They are democrats. They are not tribal, and they want to see a future for the whole of Libya where the people have a choice over how they are governed."

Hague told the Commons afterwards: "To underline our grave concern at the regime's behaviour, I can announce to the house that we have today taken steps to expel five diplomats at the Libyan embassy in London, including the military attache. The government also judged that were these individuals to remain in Britain, they could pose a threat to our security."