A lone gunman in a bulletproof vest has opened fire in an apartment and a hospital in the Netherlands, killing three people including a 14-year-old girl, police have said.

Thursday’s shooting sent patients and medics fleeing the Erasmus Medical Centre in 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 the gunman is a 32-year-old student from Rotterdam.

He was arrested at the hospital while allegedly carrying a firearm.

His identity has not been released and his alleged motive is 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 Centre 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 identities of the victims were not released.

The suspect was cooperating with police, Mr 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. It said that all appointments scheduled for Friday would go ahead as planned.

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.