The shooting on Thursday (early Friday AEST) sent patients and medics fleeing the Erasmus Medical Centre in downtown Rotterdam, including some who were wheeled out of the building in beds.
Others barricaded themselves into rooms and stuck hand-written signs to windows to show their location.
Police Chief Fred Westerbeke told reporters that the shooter was a 32-year-old student from Rotterdam. He was arrested at the hospital carrying a firearm.
His identity was not released, and the motive for the shootings was still under investigation.
He first shot and killed a 39-year-old woman and seriously injured her 14-year-old daughter at an apartment close to where the suspect lived, Police Chief Fred Westerbeke said. Police said the girl later died of her injuries.
The shooter then went to the nearby Erasmus Medical Center where he shot and killed a 46-year-old man, a teacher at the academic hospital, the police chief added. He also started fires at the scenes of both shootings.
The suspect was cooperating with police, Westerbeke said.
"It was a black day," said Rotterdam Mayor Ahmed Aboutaleb.
Dutch King Willem-Alexander and Queen Maxima expressed their sympathy on social media.
"Our hearts go out to the family and friends of the victims of the violence this afternoon in Rotterdam," the royal pair wrote.
"We also think of everybody who lived in fear during these terrible actions," they added.
The Erasmus Medical Centre appealed on social media for people not to go to the hospital, but later said it was reopening.
There have been scores of small explosions and at homes and businesses across Rotterdam this year, blamed on rival drug gangs.
There was no immediate suggestion that Thursday's shooting was linked to the feuding drug gangs.