A man drove a car into pedestrians in the German city of Heidelberg on Saturday, killing one person and injuring two others, then fled on foot brandishing a knife before being intercepted and shot by police officers.

Dramatic video footage posted on Twitter showed the alleged attacker surrounded by officers with their guns drawn, who shouted orders at him and then opened fire after a tense standoff on a footpath next to a restaurant.

One of the three people hit outside a bakery in a central square of the picturesque town was seriously injured, Anne Baas, a police spokeswoman, said. Police later said the pedestrian had been killed.

Police said they did not know have any information on the motives for the attack, which comes just over two months after an asylum seeker killed 12 people when he drove a lorry into a crowd in Berlin, but said that initial findings suggested it was not terrorism-related. The suspect was identified as a 35-year-old German man.

He got out of his Hamburg-registered rental car after ploughing into the three people and was seen brandishing a black-handled knife as he made off.