MINGORA, Pakistan — Pakistani forces killed 55 Taliban in the northwestern valley of Swat on Friday, the army said, and lifted a curfew to allow thousands more civilians to flee before troops assail the Taliban-held main town. Pakistan has vowed to eliminate militants from Swat and two neighboring districts under intense American pressure for action against extremists threatening both nuclear-armed Pakistan and neighboring Afghanistan. The military claimed Friday that militants were shaving off their beards and cutting their hair _ flowing locks were fashionable among the Swat Taliban _ in order to mingle with the refugees pouring out of the valley and escape. It appealed to the civilians to point out any militants among them to security forces, and even issued a mobile phone number so people could pass on anonymous tips. But an e-mailed army statement also said militants had mounted a counterattack, and that three soldiers were killed and 11 wounded in various clashes over the previous 24 hours. The Swat operation is a key test of Pakistan's will and ability to roll back the advance of homegrown Taliban militants, who last month seized a district just 60 miles (100 kilometers) from the capital, Islamabad, under cover of a since-abandoned peace process. The army says it is advancing slowly in an attempt to limit civilian casualties.