They gathered in the darkness every night this week, thousands of young people and parents in a queue that snaked for three kilometres, desperately fighting for a place in South Africa's badly overstretched university system.
On Tuesday morning, the inevitable happened. With 8,000 people surging toward a small gate at the University of Johannesburg, a stampede erupted, killing one woman and injuring 22 other people.
The deadly stampede has exposed the failings of South Africa's education system, where the legacy of apartheid and the mistakes of today's government have combined to leave most students out in the cold.
The country's chronically high unemployment rate, unofficially about 40 per cent, has put a premium on higher education. But its universities have limited space, vastly exceeded by the number of eligible applicants.
South African universities have room for about 150,000 first-year students this year, but about 330,000 eligible students have applied. Some universities have six or seven times more applicants than they can accept.
The University of Johannesburg, one of the biggest in the country, has room for 11,000 first-year students, but it received an overwhelming 85,000 applications for those positions.
It is also among the few universities that allow last-minute applications after the normal application period has ended. It said it might accept up to 800 of the last-minute applicants. But more than 10,000 students were applying for those limited positions.
Students began queuing outside the university at 1 a.m. on Sunday night. There were chaotic scenes on Monday, but the worst stampede broke out on Tuesday morning as thousands of people tried to push through the university's gate.
Video from the scene showed a huge crush of people pushing and shoving at the gates, with some scaling fences to enter, while police failed to establish control. Later the ground was strewn with piles of abandoned shoes and clothes, along with the body of a dead woman, reportedly the mother of an applicant.
South Africa's chronically high unemployment rate, officially 25 per cent but close to 40 per cent when those who have given up on the job market are included, has put a premium on higher education. But the country's universities have limited space, vastly exceeded by the number of eligible applicants.
Students began queuing at 1 a.m. on Sunday night to submit applications at the University of Johannesburg this week. The queue reached as far as a kilometre at one point.
South Africa's universities have room for about 150,000 first-year students this year, but about 330,000 eligible students have applied.
The University of Johannesburg, one of the biggest in the country, is among the few universities that allow last-minute applications after the normal application period has ended. But it only has room for 11,000 first-year students, and last year it received 85,000 applications for those positions.
Nearly 18 years after the end of apartheid, South Africa's education system is still facing chronic shortages of money, resources and staff. Its primary school pupils are ranked 139th in the world in literacy and numeracy, according to government reports. Barely half of its Grade 4 math teachers could correctly answer a simple fraction question from the Grade 6 curriculum, a study found.
Under apartheid, the university system was largely reserved for white people. Per capita spending on education for black children in the 1950s was only 15 per cent of the spending on white children.
Even by the 1980s, less than 10,000 black children scored high enough marks to enter university annually. Since then, the university system has expanded and become racially integrated, but has failed to keep pace with the demand.
The youth league of the ruling African National Congress said it mourned the death of the parent today, and called for urgent action to tackle the "crisis" in universities. "The doors of learning and culture should be opened," it said in a statement today.
"The ANC government should ensure that no eligible student is excluded from institutions of higher learning, because such will deepen societal ills of unemployment, poverty, starvation, crime and inequalities."
By the Numbers: Education in South Africa
23: Number of public higher education institutions in South Africa: 11 universities, six universities of technology and six comprehensive universities
87: Registered private higher education institutions in South Africa
3: South African universities on the Times Higher Education 2012 rankings of the world's top 400 universities
837,779: Students enrolled in South Africa's public institutions in 2009
45: Percentage drop-out rate among South African higher education students
Sources: Council on Higher Education in South Africa; Department of Higher Education and Technology, South Africa; Higher Education South Africa; University of Johannesburg; International Education Association of South Africa; SAGRA Graduate Recruitment Survey; Times Higher Education.