A lone gunman has killed one person and seriously injured three others inside a lecture hall at Heidelberg University in the south-west of Germany, before shooting himself dead.
He was an 18-year-old German student.
German police said the shooter, who was armed with two guns, had used a “long gun”, and fired shots around the amphitheatre “wildly”.
The bloodshed triggered a large operation at the university’s campus in the Neuenheimer Feld area.
Police asked people to avoid the area so rescue workers and emergency services could move around freely.
German media reported that the gunman appeared to have no religious or political motive.
Police have searched his flat in the city of Mannheim, and found a WhatsApp message he had sent shortly beforehand, in which he spoke of punishing people.
Heidelberg is a university town with about 160,000 inhabitants.
The country has some of the strictest gun laws in Europe, and school shootings are rare. Anyone under 25 is required to pass a psychological evaluation before getting a gun licence.
Police initially said four victims had been wounded, with a later update confirming one had died in hospital.