Libyan government jets have bombed opposition forces in support of a counter-offensive that has pushed insurgents 160 km eastwards in a week.
The government of Colonel Muammar Gaddafi, at first reeling from widespread popular uprisings last month, now appears confident of victory.
Government troops took Brega on Sunday, but the rebels said they had moved back into the important eastern oil terminal town during the night and surrounded Gaddafi's forces.
Libyan planes bombed Ajdabiyah, behind rebel lines, the only sizeable town between Brega and the rebel stronghold of Benghazi.
From Ajdabiyah there are roads to Benghazi and to Tobruk, which could allow Colonel Gaddafi's troops to encircle Benghazi.