AJDABIYA, Libya — Large numbers of rebel fighters fled this city on Sunday after a rocket and artillery attack by government forces who were reportedly on the western outskirts.

Scores of rebel pickups and other vehicles could be seen leaving the eastern approaches of Ajdabiya, and explosions could be heard in the city. They were headed toward the rebel capital, Benghazi, about 100 miles north.

Their flight seemed to end a rebel push that they said had taken them to the outskirts of the oil-refinery town of Brega, about 50 miles farther west of Ajdabiya, but some rebels did remain at positions in Ajdabiya to try to prevent it from falling to forces loyal to Col. Muammar el-Qaddafi.

Many of the fighters in the vehicles criticized NATO as failing to give them enough support and also said that they had insufficient weapons to match those of government forces.