Hundreds of mainland Chinese students fled across Hong Kong’s border into Shenzhen Wednesday, seeking temporary shelter in hostels, hotels and relatives’ homes after days of heightened violence on several university campuses in the city.

Groups of undergraduate and postgraduate Chinese students enrolled at Hong Kong universities packed their bags and left by bus, ferry or high-speed rail. Some said they were worried about their safety and made last-minute travel plans on the advice of friends, local professors and school administrators....