Atiya Azimi was up all night packing and repacking her bag, feverish at returning to school for the first time since the Taliban seized control of Afghanistan.

The joy was shockingly brief.

In the middle of a lesson, just hours after the school reopened, she learned the hardline Islamists had revoked permission for girls to study.

"Suddenly we were told to leave until another order is issued," said Azimi, who was returning to grade 12 at Zarghona Girls School in the capital Kabul.

"What have we done wrong? Why should women and girls face this situation? I ask the Islamic Emirate to start our classes."

"I did not sleep the whole night thinking about going back to school again," she told AFP.

Secondary school age girls have been out of education for around a year in many provinces.

RTL

Girls attend a class before the Taliban made a U-turn and closed schools again / © AFP

Schools were first closed under the previous US-backed government as a result of the Covid-19 outbreak, and after the Taliban took power the new rulers reopened all schools for boys.

But girls were allowed to return only to primary schools and were banned from secondary institutions in most areas.

The Islamists claimed that schools needed to be adapted so girls and boys could be segregated, despite the vast majority in conservative Afghanistan already operating separate classrooms.

The Taliban's education ministry days ago announced that girls' secondary schools would reopen for the start of the new academic year on Wednesday.

But an 11th hour U-turn by the Taliban leadership was a devastating blow for students, parents and even teachers.

"Our hopes were high but now they are shattered," said Muthahera Arefi, 17, turning around from a Kabul school to head home.

Amina Haidari, a mother of four daughters, was frustrated with how events unfolded.

"I think for girls living in the shadow of the Taliban, it is a total mess and waste of time," said Haidari, who herself lost her job in the election commission which was scrapped by the Taliban soon after they stormed back to power.

"All the statements that the Taliban make are just propaganda... We don't believe this government will reopen schools."

Across the country, groups of jubilant girls had arrived at schools on Wednesday morning carrying their bags and books, greeting their former classmates with grins and chatter.

Teacher Alia Hakimi, at Tajwar Sultana Girls School in Kabul, said the decision will leave "students weak and stressed."

At Kabul's Rabia Balkhi, one of the largest in the country, girls were not able to even make it through the school gates.

"They denied us entry into the school. It's heartbreaking for my girls," said a mother who asked not to be named.

One of her two daughters, both with a hijab covering their hair, was brimming with tears.

"I was looking forward to meeting my friends again, to be together again," said the girl, who also asked not to be named.

Some girls even pleaded to the guards to allow them entry into the premises.

"We are ready to fulfil all conditions of the Taliban, including wearing hijabs or anything but we urge them not to stop our education," said a girl from class 11.