Germans should be prepared for further attacks carried out by small groups and radicalised "lone wolves", Interior Minister Thomas de Maiziere has warned.
Five people were wounded, two critically, by a 17-year-old who went on the rampage on a train in the southern state of Bavaria on Monday.
The attacker, who arrived in Germany in 2015 as an unaccompanied migrant, was shot dead holding an axe and a knife.
A video emerged in which he said he was a soldier of so-called Islamic State.
Was it really an IS attack?
Mr de Maiziere said the teenager had been "incited" by IS propaganda but there was no evidence that he was following the militant group's orders.
Witnesses said the attacker, Muhammad Riyadh, screamed "Allahu Akbar" (God is great) three times, and IS has claimed the teenager as a follower through its news agency. A hand-painted IS flag was found in his room.
However, he was unknown to German intelligence and no concrete link has yet been established with IS.
The government was doing all it could to prevent such attacks, the minister said, but there could be no guarantee.
The interior minister described Monday night's axe attack in Wuerzburg as "perhaps half-way between running amok and terror".
"In Germany we must also expect attacks by small groups or radicalised 'lone-wolf' attackers," he said.
Who was attacked?
Of the five people wounded, four were a family from Hong Kong and German officials said on Wednesday that two remained in a critical condition.
A man of 62 and his daughter's boyfriend suffered severe head wounds and are being treated in intensive care.
"The assailant started attacking my sister's boyfriend and when my mother and father saw they tried to get in the way and got hurt," Silvia Yau told Hong Kong's Apple Daily.
The mother and daughter were also wounded but their 17-year-old son escaped unhurt.
There was no indication that the family had been targeted specifically because they were Chinese.
Was the teenage attacker really from Afghanistan?
Muhammad Riyadh had only just moved to a foster family in Wuerzburg from a refugee centre at Ochsenfurt south of Frankfurt.
He was described as a quiet boy who had had a work placement in a bakery and had not displayed any radical behaviour.
But questions have now been raised about whether he was really from Afghanistan. A Pakistani document was found in his room, reports said.
It is common knowledge that Afghan refugees are more likely to be given asylum in Germany than irregular migrants from Pakistan, so there have been many cases of migrants pretending to come from Afghanistan.
Several clues to his origin have emerged from the video he filmed before he attacked the regional train near his home.
Speaking Pashto
His use of the Pashto language suggests he at least spent some time in Pakistan, because of his choice of words.
When speaking of Syria, Riyadh chose Sham, the word used in Pakistan. In Afghanistan, Pashto speakers would say Suria.
His choice of term for Army is also key. He says Fauj, which is common in Pakistan, rather Aurdu, the word used in Afghanistan.
Many Afghans have lived in Pakistan for years, particularly since the rise of the Taliban. So Riyadh could well have spent all his life in Pakistan, despite being ethnic Afghan.
Last year Germany registered more than one million migrants, including more than 150,000 Afghans, although the number has slowed dramatically this year since new EU measures were taken to stop the flow.