A lone gunman has killed one person and seriously injured three others inside a lecture hall at Heidelberg University, before shooting himself dead.
German police said the shooter 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.
Heidelberg is a university town in the southwest of Germany, 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.
German newspaper Bild reported that the shooter was a student at the university.
Police initially said four victims had been wounded, with a later update confirming one had died in hospital.