German police arrested a 52-year-old man on Friday, for allegedly fatally stabbing his ex-wife and her child outside their home.

Freiburg police said in a statement that a German citizen of Algerian heritage fled in a car after stabbing a 39-year-old woman and her four-year-old son in the nearby town of Teningen in Baden-Württemberg.

Emergency workers tried to revive the pair but they later died in hospital.

The woman had a restraining order against the man after a failed marriage.

He attacked after an argument as they sat in their car, which was blocked in by his car, the prosecutor said.

Neighbors were drawn to the attack by the screams and alerted the police. The man was arrested several kilometers away without putting up resistance, police said.

Also on Friday a knife attack in a Hamburg supermarket left one person dead and several injured.

Read more: Deadly knife attack in Hamburg supermarket

aw/msh (dpa, AFP)