JOHANNESBURG — They lined up well before dawn, some driving from the deep countryside with bags of fluffy blankets and neatly packed sandwiches, to wait for the gates to a new life to open. They hoped for a shot at a coveted spot at one of South Africa’s public universities, and with it a chance to escape the indignity of joblessness that afflicts more than a third of the nation. By morning, the line was more than a mile long.

As the gates were about to open at 7:45 Tuesday morning, thousands of students, many accompanied by their anxious parents, surged forward, desperate to win one of several hundred last-chance places still open at the University of Johannesburg. Amid shoving and screams, one woman, the mother of a prospective student, was trampled to death and several others were badly injured in a frantic scrum.

The stampede embodied the broad crisis in South Africa’s overstretched higher education system as it struggles to extend opportunities once reserved for whites to all South Africans. It is a problem of grade school mathematics: Too many students are seeking too few seats at the country’s public universities, which turn away more than half of their applicants, leaving few options for most high school graduates.

Not only that, the squeeze plays into a wider problem of unemployment among young people.

The jobless rate among youths is nearly 70 percent, a staggering problem that even a college degree does not promise to solve. Adcorp, a temporary staffing firm, said in a recent report that there were 600,000 unemployed college graduates in South Africa.