South African President Jacob Zuma has ruled out any increases in university tuition fees for next year after more than a week of protests by students.
They have been the biggest student protests to hit the country since apartheid ended in 1994.
The students had rejected an earlier government offer to cap increases at 6%, down from the 10% to 12% proposed by the management of universities.
Mr Zuma announced the move as students gathered by his office in the capital.
Before he spoke in a TV address, police had been using stun grenades and water cannon to stop a group of students breaking into the Union Buildings, the seat of government in Pretoria.
The demonstrations have closed some of the country's top universities.
"We agreed that there will be a zero increase of university fees in 2016," Mr Zuma said after meeting university officials and student representatives.
"In the long term, there is a package of issues that was raised at the meeting that needs to be followed up - these include free education, institutional autonomy [and] racism."
Analysis: Milton Nkosi, BBC News, Pretoria
President Zuma's agreement to freeze all university increases to meet the demands of the #FeesMustFall campaign will be welcomed by those who have been at the forefront of this student movement, unprecedented since the end of apartheid.
But the decision could have been taken much earlier. The protests have been going on for a little over a week. If it had been, we could have avoided the stun grenades and tear gas, which were fired at student protesters here at the Union Buildings.
The protests have cut across South Africa's deep political divide: Black and white, rich and poor stood side by side. No political parties were involved. This is taking the country in a new direction of organic, popular protest, likely to play into next year's local government elections.
The hashtag #FeesHaveFallen is now trending across the country, but I doubt this will be the end of the problems facing South Africa's students.
There were chaotic scenes at the Union Buildings following the president's speech, with some students angry that Mr Zuma had chosen to make the address on national TV, rather than come out to speak to them directly.
Pictures on social media showed police cars that had been damaged and one which was overturned.
It is unclear how the freeze on South African university fees will be funded, Vice Chancellor of the University of Cape Town, Max Price, told the BBC after attending meeting with the president.
The government said it did not know how much they would pay or where the money would come from, he added.
Local media reported that police fired rubber bullets to drive protesters away from the grounds around the president's office.
During the protests, universities said they needed to increase fees to maintain standards, a they had been hit by a fall by in government subsidies.
Correspondents say the protests have shown the growing disillusionment with the governing African National Congress (ANC), which took power after minority rule ended in 1994, over high levels of poverty, unemployment and corruption in government.
Many black students say they come from poor families, and the fee increases would rob them of the opportunity to continue studying.
Financially better-off white students have also joined in, mainly to show solidarity with the black students.