CAIRO -- Hundreds of Egyptian high school students staged a rare protest in Cairo's iconic Tahrir Square on Monday before security forces quickly moved in, dispersing them with tear gas and detaining several.

The students were protesting the cancellation of high school exams -- which directly determine university placement -- after someone leaked the answers to some of the tests to protest alleged corruption and mismanagement in the Education Ministry.

The students, accompanied by some parents, began their demonstration in front of the ministry, demanding the resignation of Education Minister Al-Helali el-Sherbini. They later marched to Tahrir, the epicentre of the mass protests that forced longtime autocrat Hosni Mubarak to resign in 2011.

Egypt outlawed all unauthorized protests after the military ouster of President Mohammed Morsi two years later, and security forces have maintained a heavy presence in and around Tahrir since then.

Mohammed Sadiq, a graduating 18-year-old who wants to be an architect, said the students were holding a peaceful march in Tahrir when police began beating them, and now some were angered by the detention of their classmates.

"We came to protest about the exams -- our final year is very important," he said. "But they attacked when we came to the square. The whole system needs to be changed, we deserve a better education than this one."

Broken glass lay strewn about a main approach to Tahrir, and the central roundabout was ringed with over a dozen troop carriers filled with security forces, some of whom were heavily armed and masked.

As the sun set, the students returned to a subway station near the ministry where they had been earlier. The police remained out in force, but the situation was calm.

Twelve Education Ministry officials were detained after answers to the final nationwide exams for Arabic, religion and other subjects were posted earlier this month on Facebook by an anonymous user, who said he wanted to shine a spotlight on corruption and inefficiency.

Egypt's education system has long been plagued by overcrowded classrooms and poorly trained teachers, forcing millions of students to rely on private tutors -- if they can afford it.

"Every year the exams are leaked, what is new?" said student Sarah Mohammed, adding that she hoped the minister would resign and that the sector would be reformed.

"This is unfair," said Amr Adel, another student. "The student who didn't study will get higher grades than us. We were studying hard for 12 months... Why all this unfairness?"