AJDABIYA, Libya — Behind tanks, heavy artillery and airstrikes, forces loyal to Col. Muammar el-Qaddafi routed a ragtag army of insurgents and would-be revolutionaries who were holding the last defensive line before the rebel capital of Benghazi on Tuesday.

Blasts of incoming fire came every few seconds at the edge of this city straddling a strategic highway intersection, where rebels have bulldozed berms and filled hundreds of sandbags around two metal green arches marking the western approaches to the city.

As the shelling intensified Tuesday, hundreds of cars packed with children, mattresses, suitcases — anything that could be grabbed and packed in — careened through the streets as residents fled. Long lines of cars could be seen on the highway heading north to Benghazi, about 100 miles away.

In Benghazi itself, though, there were no signs of preparations for a vigorous defense, and there were reports on Tuesday night that rebels may have retaken parts of Ajdabiya. Witnesses said that by evening rebel fighters seemed to be patrolling the streets, and there was speculation that loyalist soldiers may have withdrawn to the perimeter after overrunning the city, a pattern they have followed in previous battles.