Twenty-five other people were wounded before the gunman killed himself.
The students formed a human chain around the building in a symbolic hug before lighting a fire at the square while bells in nearby churches tolled for 14 minutes.
Meanwhile, university authorities were working with police and the Education Ministry on possible plans and measures to improve security.
The shooter was Czech and a student at the Faculty of Arts. Investigators do not suspect a link to any extremist ideology or groups. Officials said they believed he acted alone, but his motive is not yet clear.
Previously, the nation’s worst mass shooting was in 2015, when a gunman opened fire in the southeastern town of Uhersky Brod, killing eight before fatally shooting himself.