The motive behind the attack is unclear, with the 32-year-old suspect first entering the home of a 39-year-old woman living in the neighbourhood.
The attacker fatally shot the woman and seriously wounded her 14-year-old daughter, who later died as a result of her injuries.
The gunman then entered the Erasmus University Medical Center, where he was a student, and shot dead a 46-year-old teacher.
The man also reportedly started fires at both addresses.
Police arrested the suspect near the hospital's helipad, where he was dressed in camouflage and wearing a bulletproof vest.
Rotterdam's chief prosecutor told the press that the man was known to law enforcement and had previously been convicted on animal abuse charges in 2021.