Colonel Gaddafi's forces have changed their tactics.
The Libyan army has not always been known for its efficiency or its high morale.
Now though, it has shown a remarkable degree of flexibility, and has chosen to adopt tactics used by the rebels only a few days ago, when they were sweeping along the coastal road, apparently unstoppably, in the direction of Sirte.
The sudden turnaround of fortune is the result of several factors.
The first is that Colonel Gaddafi's army has decided to follow methods which the rebels have used so successfully.
Its men are racing forward in the ordinary flat-bed trucks known elsewhere in Africa as 'technicals', with heavy machine-guns or anti-aircraft guns mounted on the back.
Others are equipped with mortars. Though these are quite light, they often cause great panic among the rebels, and are quick and easy to move forward.
Once the pro-Gaddafi forces managed to regain momentum, there was another shift in morale, and the rebels lost the confidence they had built up during the previous days.
The rebels have no perceptible command structure.
Individual gunners and their crews decide to go forward, if and when they choose, and vanish from the front line once they have had enough fighting.
Their morale has often been very high indeed, but when they are being beaten, it is easy for a retreat to turn into a rout.
The same is not true of Colonel Muammar Gaddafi's army.
Their skills are not particularly impressive, and their morale until recently was noticeably lower than that of the rebels.
But when they are forced to withdraw, as they were at the start of the week, their training means that they can halt and regroup much more effectively than the rebels can.
And they have officers to urge them back into the fighting. The rebels have few, if any, officers.
In the past, too, the rebels became used to the sight of Col Gaddafi's soldiers manoeuvring into positions from which they could surrender and come over to the other side.
But by now, most of the pro-Gaddafi forces who want to switch will probably have done so.
Here in Tripoli, government officials are noticeably relieved and happy.
Just a few days ago they had to come to terms with the possibility that the rebels would capture Sirte and then advance up the coastal road to Tripoli itself.
There is another problem for the rebels. After the big advances which the pro-Gaddafi forces started making towards Benghazi 10 days ago, intervention by the coalition turned things round.
But it was fairly easy to destroy tanks and artillery from the air, even though, as we now know, the coalition's aircraft and missiles had difficulty dealing with tanks that had been well camouflaged or were stationed in narrow streets between houses, where ordinary civilians live.
Now the pro-Gaddafi forces have largely switched to the use of "technicals" of the kind the rebels use, the coalition will have much more difficulty identifying which ones belong on which side.
If the rebels try to mark their vehicles in some way, the pro-Gaddafi forces can be expected to follow suit.
The best that the rebels can probably hope for now is that the situation will stabilise and a stalemate can be established at some point along the coastal road to the east of Sirte.
That would make it far easier for coalition planes to identify the pro-Gaddafi troops.
But for that to happen, the rebels will have to overcome their terror of Col Gaddafi's mortars and the light motorised guns which his officers have copied from the rebels' own, and make a stand.
There may well be more changes of fortune to come along the coastal road.