BERLIN — A German man has been arrested after repeatedly driving into crowds of people, injuring at least five, in what authorities said Tuesday appeared to have been intentional attacks against foreigners.

Four people were injured in the western city of Bottrop and one person was injured in nearby Essen, while pedestrians managed to jump out of his path in two other attempted attacks in those cities, police said.

“The man had the clear intention to kill foreigners,” German news agency dpa quoted the top security official in North Rhine-Westphalia state, Herbert Reul, as saying.

The victims included a 46-year-old woman, who suffered life-threatening injuries, and a child. Some of the victims were Syrian and Afghan citizens.

The attacks began shortly after midnight while people were celebrating New Year’s out on the streets.

The 50-year-old driver first attempted to hit a group of people in Bottrop, but failed. He then drove into the city center, where he slammed his silver Mercedes into a crowd, injuring four.

He then drove toward Essen, where he twice attempted to run people down, injuring one person, before being arrested by police.

The man, whose name wasn’t released, is being held on suspicion of attempted homicide. Police said the suspect made anti-foreigner comments during his arrest and there were indications he had been treated for mental illness in the past.

It’s not the first time that a vehicle has been used as an apparent weapon in Germany.

In April, a German man drove a van into a crowd in Muenster, killing four people and injuring dozens. The driver, who had sought psychological help in the weeks preceding the attack, then killed himself.

On Dec. 19, 2016, a Tunisian man ploughed a truck into a busy Christmas market in Berlin, killing 12 people. The attack was claimed by the Islamic State group. The driver, who fled the scene, was later killed in a shootout with police in Italy.