A two-year-old girl and her mother died on Saturday from injuries suffered in the car-ramming attack which happened two days ago in the German city of Munich that left 37 others injured, police said.

"Unfortunately, we have to confirm the deaths today of the two-year-old child and her 37-year-old mother," police spokesman Ludwig Waldinger told AFP.

An Afghan man was arrested on suspicion of deliberately driving a car into a trade union demonstration on Thursday.

Police said the 24-year-old asylum seeker, identified by German media as Farhad N., may have had Islamist extremist motives for the attack.

After the incident, the suspect uttered the words "Allahu Akbar" (God is greatest) to police officers and also prayed, prosecutor Gabriele Tilmann said on Friday.

The carnage came shortly before Germans head to the polls for a February 23 election where immigration is a key issue following a spate of attacks blamed on migrants.

Farhad N. was living in Germany legally, worked in security and was also heavily involved in fitness and bodybuilding, Tilmann said.

He was "very religious and also displayed this outwardly", regularly attending a mosque and making online "posts with religious references", she added.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.