Fritz von Weizsaecker, a doctor, had just delivered a lecture on liver diseases at the Schlosspark hospital in the west Berlin neighbourhood of Charlottenburg on Tuesday evening when he was stabbed in the neck.
The 59-year-old, a father of four, died at the scene despite efforts to save him.
His assailant was overpowered by other people present, one of whom was severely injured in the process.
Prosecutors said the 57-year-old attacker had bought the knife in his home state of Rhineland-Palatinate in the far west of Germany and travelled to Berlin by train.
They said he had been diagnosed with an “acute mental illness” and had a “probably delusional general dislike” of the Weizsaecker family.
Richard von Weizsaecker was considered one of Germany’s great post-war political figures.
Spiegel magazine said the suspect had researched the elder Weizsaecker’s role on the board of chemicals giant Boehringer Ingelheim during the 1960s before he began his political career.
The company at the time reportedly supplied the United States with some of the chemicals in Agent Orange, a powerful defoliant used in the Vietnam War that caused severe health problems for humans exposed to it.
Weizsaecker was president of West Germany from 1984 to 1990, and then held the same position in the united Germany from 1990 to 1994.
He was previously a deputy in the lower house of parliament for the CDU now led by Chancellor Angela Merkel, and mayor of West Berlin.
He died in 2015.
The victim was a member of the liberal FDP party, whose leader Christian Lindner voiced his grief about his friend on Twitter, saying that “once again we ask ourselves what sort of world are we living in.”
Merkel said the killing was “a terrible moment for the von Weizsaecker family”, her spokesman Steffen Seibert told reporters.
bur-dt/mfp/cdw