SHEIKH JANA, Pakistan — The Pakistani forces air-dropped commandos into the main town in Buner on Wednesday and quickly retook control of it from Taliban militants who flooded into the area last week, the military said. But the district was far from recaptured and the military may be in for a hard fight.

Villagers who fled the fighting and made it to this village on the plains said the military was bombing in Buner with fighter jets and firing rockets from helicopter gunships as Pakistani troops battled the Taliban on the ground for a second day.

Despite a curfew imposed by both the Taliban and the army, one villager, Walayat Khan, a cowherd in his 20s who did not know his exact age, said everyone was trying to get out of the district.

Some people were leaving on foot, as few vehicles were available. Those who left were forced to use back roads since the Taliban and military forces had blocked the main arteries leading into and out of Buner.