At least 15 people were injured, four severely.
The suspect, who had been living in his car, was intoxicated and would undergo a psychological evaluation, said the state’s interior minister, Roger Lewentz.
The car sped for more than a half-mile through the picturesque medieval city center and past the city’s Christmas tree, zigzagging to apparently maximize casualties, before being cornered by police, he added.
Video posted online showed a man being pinned to the ground by police next to a silver-gray vehicle along a bike lane. Another showed the mayhem inflicted: ambulances and paramedics on a shopping street strewn with debris.
One witness quoted in the local media described a stroller flying in the air as the car flew through the market area. The dead also included a 73-year-old woman, 45-year-old man and 25-year-old woman, authorities said.
Speaking to reporters, the city’s mayor, Wolfram Leibe, was overcome with emotion.
“We often see such images on TV, and think, ‘That can’t happen to us here,’ ” he said. “But now it’s happened in Trier.”
He called the scene “just terrible.”
“There was a sneaker, and the girl it belonged to is dead,” he said, fighting back tears and handing over the microphone to a colleague.
Some European cities have added bollards and concrete blocks in pedestrian areas in recent years after a spate of car-ramming attacks, including one in the French city of Nice on Bastille Day 2016 that killed 86 people and was claimed by Islamic State militants. Twelve people died in a truck attack on a Berlin Christmas market later that year.
“I don’t know the motivation of the perpetrator,” Leibe said, adding that he was “crossing my fingers” that all those injured survived.
Leibe said the police arrived on the scene five minutes after the initial calls and were met with “wild chaos.”
Authorities said the perpetrator was local, from the district of Trier-Saarburg.
“What in Trier happened is shocking,” government spokesman Steffen Seibert tweeted. “Our thoughts are with the relatives of the victims, with the numerous injured and with everyone who is currently on duty to care for those affected.”