An Afghan man admitted to stabbing and severely injuring a family of three and a 20-year-old compatriot in Vienna because "he was in a bad, aggressive mood and upset about his life's situation," Austrian police said Thursday.

Police said in a statement that the 23-year-old said he committed all four stabbings, and denied any of his attacks were politically motivated.

The attacker was detained shortly after the stabbing of a 20-year-old man, also from Afghanistan, on Wednesday night, police spokesperson Patrick Maierhofer told The Associated Press.

An hour earlier, he attacked all three members of a family — the 67-year-old father, the 56-year-old mother and their 17-year-old daughter — also in the city's downtown area.

Police said the father was still in a critical condition, but his wife and daughter and the Afghan man were stable. All four were still in hospital Thursday. Their names and the name of the attacker were not released.

While the attack on the Austrian family appeared random, the attacker told police he knew his fourth victim, and said he specifically sought him out because "he holds him responsible for his previous drug addiction."