By Tanisha Heiberg

JOHANNESBURG (Reuters) - South African police fired stun grenades and arrested 31 students in clashes at Johannesburg's University of the Witwatersrand on Tuesday, as countrywide protests demanding free tertiary education entered a third week.

Demonstrations this year and in 2015 over the cost of university education -- prohibitive for many black students -- have highlighted frustration at the inequalities that persist more than two decades after the 1994 end of white minority rule.

The current protests were triggered by a government recommendation that 2017 tuition fee increases be capped at 8 percent - above South Africa's current inflation rate of 6 percent.

Critics have said the increase would further disadvantage black students already under-represented.

Several students hurled rocks at the main building of the university known as "Wits", shattering windows, after they were prevented from entering by private security guards who retaliated by throwing rocks back at the students.


The students later discarded their rocks and entered the building under heavy police presence, where they gathered in a hall seeking an audience with university authorities.

Nompendulo Mkatshwa, outgoing president of the student representative council, said police had fired stun grenades at students gathered near the university.

"Students are not happy with what the Department of Higher Education and Training said, so they are fighting for equal education," Mkatshwa said.

Police spokesman Lungelo Dlamini said the arrested students "were blocking the entrance of the university in contravention of the court order" and were being held at a nearby station.

Local television channel eNCA said the students had been released but police were not immediately available to comment.

Weeks of violent demonstrations last year over university costs, forced President Jacob Zuma to rule out fee raises for 2016 but university authorities have warned that another freeze for this year could damage their academic programs.

Tshwane University of Technology in the capital Pretoria and the University of Cape Town were also affected by protests.

Earlier this month, 32 students were arrested after arsonists torched a law library at South Africa's University of KwaZulu-Natal following days of protests by students over the cost of tuition.

The Treasury's director-general, Lungisa Fuzile, could not confirm whether the government would give more money to students, who are demanding increased state subsidies.

"The budget is very big, 1.4 trillion rand ($101 billion) or thereabout. There is always scope within limits to reprioritize resources within that envelope," he said.

(Additional reporting by Wendell Roelf; Writing by James Macharia; editing by Ralph Boulton)