The Taliban have reversed a decision to allow Afghan girls to return to high schools, saying a ruling is still to be made on the uniforms they must wear.
Schools were set to open nationwide after months of restrictions since the Taliban seized power in August.
But the education ministry abruptly announced girls' secondary schools would stay shut, causing confusion.
Some girls were in tears as parents and students reacted with anger and disappointment to the last-minute move.
Many had earlier talked of how happy and excited they were to be back in the classroom.
The decision came a week after the education ministry announced schools for all students, including girls, would open around the country on Wednesday.
"We inform all girls' high schools and those schools that [have] female students above class six that they are off until the next order," the notice said.
The notice added schools would reopen after a decision over the uniform of female students was made in accordance with "Sharia law and Afghan tradition".
The sudden reversal has sparked deep anger from parents of female students.
Allow Twitter content?
A man who did not want to be identified told the BBC his daughter had been in shock and in tears since being refused entry by Taliban officials into the school this morning.
"If anything happens to my daughter, I will not forgive the Taliban," he said.
Under Taliban rule in the 1990s, girls were banned from getting an education. And since the Taliban took power again last August, only girls' primary schools along with all boys' schools have remained open in most of the country.
Girls' secondary schools were finally meant to open today.
Privately, Taliban members admit female education remains a controversial issue amongst their most hardline elements.
This chaotic and last-minute policy reversal makes clear the divisions within the group - and underlines how out of touch with the aspirations of modern Afghan society parts of the leadership are.
Activist Mahouba Seraj, founder of the Afghan Women's Network, was bemused by the U-turn.
"The excuse they gave was 'you don't have the proper hijab on'. There was no ruling, they just decided this morning that the hijab was not proper, for whatever reason," she told the BBC.
She said girls' "school uniforms in Afghanistan are pretty covered up, always". Secondary schools in Afghanistan are already segregated by gender.
One of the demands of the international community was for the Taliban to grant women and girls the right to education before being able to access foreign aid.
Ms Seraj said: "What I want to hear from them and see from them is for them to stand fast and say 'okay, this is what you decided to do? Well, this is what we have decided to do: no recognition, no money. Period!'"
The United Nations mission in Afghanistan said it "deplores today's reported announcement by the Taliban".
US diplomats said closing schools undermined confidence in Taliban commitments and assurances.
It "further dashes the hopes of families for a better future for their daughters," US special envoy Rina Amiri tweeted.