Protesters stormed an administration at Al-Azhar University building after they demonstrated in support of Mohamed Morsi on Wednesday.
Twenty-five were arrested amid clashes with security, judicial officials told Ahram Arabic news website.
According to the lawyer representing those arrested, only eight of them are Azhar students. This was confirmed by a security source, who added that many protesters had entered the campus illegally.
Security forces were allowed onto campus upon the request of the university's President, after clashes escalated in the second week of protests at the university.
Morsi supporters calling for his reinstatement stormed the administration building Wednesday and threw documents out of the windows. According to a security official quoted by state television, protesters held the university president and some of the staff inside the building against their will.
Eye-witnesses told Ahram Online reporter at the scene that university security forces had initially used water cannons in an unsuccessful attempt to disperse the protesters.
Ahram Online reporter also heard gunshots during the melee.
Both parties claimed the other side had started the clashes. Student protesters told Ahram Online they were demonstrating peacefully when security opened water cannons against them. University security denied the allegations and said they had reacted to protesters hurling stones.
Supporters of Islamist president Mohamed Morsi have been staging regular protests calling for his reinstatement since he was ousted in July. Protests have resulted in clashes with security forces on more than one occasion.
Since the beginning of the new academic year, demonstrations have shifted to university campuses. Al-Azhar, a key centre of Islamic learning, has seen regular protests since classes started two weeks ago.