A lone gunman opened fire during a packed lecture at Heidelberg University in south-western Germany and wounded four people – one of them fatally – before killing himself, police said.
The 18-year-old suspected gunman was a biology student at the university, said Siegfried Kollmar, the regional chief of police.
The suspect, a German citizen with no known police record, sent a phone message to his father shortly before the shooting which mentioned that “people will be punished”, Mr Kollmar told reporters.
The precise motive for the attack was still being investigated, but the suspect was known to have suffered from a psychological illness in the past, he added.
His body was found outside by officers along with two firearms he had recently acquired abroad and about 100 rounds of ammunition, said Mr Kollmar.
Police identified the woman who was killed as a 23-year-old German. Those who suffered minor wounds were two German women and a German-Italian man.
The shooting sparked a massive police response, with more than 400 officers sent to the scene.
German Chancellor Olaf Scholz expressed dismay over the shooting and offered his condolences to relatives, victims and students.
“It’s been reported that one student has died of her injuries,” he said. “It tears my heart apart to learn of such news.”
Heidelberg is located south of Frankfurt and has about 160,000 residents. Its university is one of Germany’s best-known.