Two Cape Peninsula University of Technology (CPUT) students were released on R800 bail each on Wednesday evening.
This after they were arrested for public violence on Tuesday, their lawyer said.
Lufuno Musetsho said a deal was reached with the standby prosecutor for their release.
The two are expected to appear in the Cape Town Magistrate's court on Thursday.
Musetsho wished not to divulge the names of his two clients. He said they will be opposing the charges against them.
"They are unhappy with the circumstances surrounding their arrest. My instructions are [that] they weren't part of the group of protesting students and further that they were randomly picked by the police," Musetsho told News24.
After protests on the campus on August 31, the CPUT approached the Western Cape High Court for an urgent interdict to prevent the four and any other individuals from trespassing, occupying buildings or acting illegally.
A university workshop on the Cape Town campus was petrol bombed in the early hours of Monday morning.
Stun grenades were fired to disperse protesting students on Monday afternoon, who were unhappy with the insourcing process and the suspension of four students.
However, not all students were on the same page. Some told News24 they did not want the protest to happen.
They said they had tried raising their concerns with the protesting group but felt they had no voice.
On Wednesday, the university closed its Mowbray campus because of student protests.
"This morning, a group of protestors disrupted classes on the Mowbray campus. The campus has shut down until further notice. Students and staff are advised to engage with their lecturers and line managers in this regard," CPUT said in a statement.
The university said the campus would reopen on Thursday after "security assessments" were concluded.