The University of Nairobi has closed following a series of violent clashes between the administration, students and police.

The top Kenyan university, with more than 84,000 people enrolled, announced that students had until 9am on Tuesday to leave their residence halls.

This meant students had less than 12 hours to move out. Many of them refused to leave until they got their fees back.

Students took to social media to complain about the university's closure, fearful of the consequences on their studies.

At this rate,this will be my Graduation photo when I finally graduate from University of Nairobi Med school. #MbithiMustGo pic.twitter.com/Gxj5ufDDYO — Lunatic_Journalist (@AdOketch) October 3, 2017

The closure follows the institution’s vice-chancellor’s decision to call anti-riot police to the campus on Thursday, when students were demonstrating for the release of an imprisoned opposition politician.

Police officers clashed with students and dozens were injured, according to local media.

#UoNclosed When parents have struggled to get you to school, they walk daily to do hard jobs to keep you in school then Raila happens sad! — Sandrah Njoki (@Sandrahnk) October 3, 2017

On Monday there were new rounds of demonstrations, this time for the resignation of the university's vice-chancellor, Peter Mbithi.

A few hours later his Twitter account announced the closure of the university, one of the oldest in Kenya.

Leaders of the Kenya Universities Student Organisation (KUSO) "condemned the brutality meted out by police" and "demanded swift investigations of the rogue officers".

How comes the students who organized demos in University of Nairobi have been identified & expelled yet police who attacked them are free? — Betty Luke (@bettyowino) October 3, 2017

"Freedom of speech and peaceful demonstrations are fundamental and irrevocable rights of every citizen," a member of KUSO wrote on Facebook.

More than 84,000 students attend the University of Nairobi and more than 2,000 people work there.