A note found in the Afghan train attacker's room where he also kept a hand-painted flag of the Islamic State group indicates he may have been self-radicalized, a top German top security official said Tuesday.
The attacker was a resident of Germany for two years and he was shot dead by police at the scene.
Leung's office said Hong Kong and Chinese officials were in touch with the German embassy to follow up on the case, and representatives were en route to visit the family.
"It is quite probable that this was an Islamist attack", said a ministry spokesman, adding that the assailant had shouted "Allahu akbar" (God is greatest).
Blood stains and a rescue blanket are seen through the windows of a train in Wuerzburg, southern Germany, Monday evening, July 18, 2016, after a 17-year-old Afghan armed with an ax and a knife attacked passengers ab... The assailant was shot dead by police as he fled the scene.
Earlier on Tuesday, the Islamic State extremist group claimed responsibility for the attack through the affiliated Aamaq News Agency.
"The perpetrator of the stabbing attack in Germany was one of the fighters of the Islamic State and carried out the operation in answer to the calls to target the countries of the coalition fighting the Islamic State", the statement said.
The Islamic State group has claimed responsibility for an attack on a train in Germany that injured at least five people.
Early reports had suggested he had yelled "Allahu akbar" but police later said there was no evidence pointing to a religious motive.
He was placed in a shelter in the Wuerzburg region in March before being settled with a foster family.
A text written in Pashtun was also found, he said, and it showed a strong indication that the teenager "could be a person who had been self-radicalised".
Renate Kuenast, a leading politician from Germany's Green Party, has criticized the police's behaviour, saying he should have been incapacitated - not killed.
Herrmann said initial information was that the suspect came to Germany as an unaccompanied minor and had lived in the Wuerzburg area for some time, initially at a refugee facility in the town of Ochsenfurt and more recently with a foster family.
He was later sent to a psychiatric hospital and authorities said they had found no links to Islamic extremism.
Four passengers who were attacked are in serious condition, with the total number of wounded unclear, according to the police spokesman.