CAPE TOWN (Reuters) - South African police fired rubber bullets, tear gas and stun grenades on Wednesday to disperse hundreds of student protesters demanding free education at the University of the Western Cape in Cape Town.

Protests have taken place for weeks at universities across the country, prompting President Jacob Zuma last week to form a ministerial team to tackle the issue.

The university said in a statement it was suspending classroom lectures for the rest of the academic year, which ends in December, and would give students the choice of writing final examinations in November or January.

"Today the situation on campus escalated and it has become clear that simply continuing with face-to-face academic engagement would not be possible without seriously compromising the safety of students and staff," the university said.

A private security guard was badly beaten by demonstrators in the latest clash and a campus building was set on fire, a Reuters witness said.

The protests over the cost of university education, prohibitive particularly for black students and set to rise by up to 8 percent next year, have highlighted frustration at the inequalities that still endure, more than two decades after the end of apartheid.

Police in the capital Pretoria warned the public of an expected march by students on Thursday to the Union Buildings, where the government has its seat.

(Reporting by Mike Hutchings; Writing by Ed Stoddard; Editing by Angus MacSwan)