Pakistan education authorities have reversed a decision making it compulsory for female students in two major northwestern cities to wear veils, one day after the move sparked a rights outcry on social media.

District education officials in Peshawar, the capital of Khyber Pakhtunkhwa, and Haripur, another city in the conservative province, had announced that girls must cover themselves fully "to protect them from any unethical accident".

But the directive, first announced last week, triggered a nationwide backlash, as social media users and activists condemned the move as yet another curb on women's rights in a deeply misogynistic country.

"So the burden of unethical behaviour lies on schoolgirls and not the pervs who harass girls, regardless of them being covered," tweeted one social media user, Naila Inayat, in a typical comment.

The backlash resulted in a reversal by authorities.

"The directive is hereby withdrawn," a new order issued Tuesday and seen by AFP said.

However leading Pakistani women's rights activist Tahira Abdullah warned that the attempt "did not enhance the image of Pakistan".

"While the rest of the world is moving forward with its children's education, protection and development, Pakistan is definitely moving backwards," she told AFP.

However some residents in the region defended the move.

One provincial legislator, Siraj-ud-din Khan, warned that his radical Jamaat-e-Islami party would protest and "force the government to enforce this order in the whole of the province".

Local shopkeeper Jameel Ahmad and teacher Ameen Sadiq also vented their anger at the government's decision to reverse the order, saying that under Islam and Pashtun tribal tradition dominant in the northwest women must be properly covered.

But Amna Haleem, a geology student in Peshawar University, ridiculed the claims, calling for a woman's right to choose whether to cover herself or not.

"The state should not interfere in such matters and leave them to discretion of womenfolk," she said.