Nearly 90 people were brought to safety from the destroyed building, civil defence services in the Baltic Sea port said on Saturday.
Initial reports said that no serious injuries or deaths had occurred in the incident.
It's not unusual for classes to take place at the weekend in Russia.
The cause of the accident was not immediately clear. Video footage showed how cracks developed in the building's walls within seconds before they buckled. At least four storeys had collapsed.
"In the middle of class, we suddenly heard a loud creak and strange sounds," the rector, Vladimir Vassilyev, told Interfax news agency.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
The building belonged to the ITMO University in St Petersburg and was in the historic centre of the metropolis. According to media reports, repairs were being carried out in the building before the collapse.
Officials are investigating whether any safety violations occurred.
