Early on in the uprising, anti-government forces gained control of the town and oil production facilities. Government forces attempted to regain control of the area on 2 March, but were repulsed by the rebels. On 15 March, government forces retook Brega during their initial counter-offensive, as the disorganised rebel forces were crushed by the Loyalist's heavy weapons and air power. On 26 March, after the UN imposed a no-fly zone which removed the threat of Loyalist air attacks, rebels advanced rapidly, taking Brega back from Gaddafi's forces but were quickly forced to retreat after a Loyalist counter-offensive. By 31 March, the frontline had stabilised between Brega and Ajdabiya, with rebel forces launching numerous attacks on the town, which all resulted in hasty retreats. Eventually after pushing the Loyalists back from Ajdabiya, the rebels once again launched an assault on the strategic oil town.