BERLIN — An older driver in a station wagon with white hand-painted letters crashed a station wagon into the gate outside Chancellor Angela Merkel’s office on Wednesday morning, but did not get past the barrier and was then detained.

Although the driver’s motive was unclear, it could be connected to an expected government extension on Wednesday of a partial lockdown to stem coronavirus infections. The police confirmed that the driver was in custody.

The message “You damned murderers of children and old people” was painted on one side of the car, while the other side read, “Stop the politics of globalization,” according to pictures of the crash site.

Hartmut Paeth, a spokesman for the Berlin police, said that officers were “in the process of clarifying with the elderly gentleman, whom we have in custody as a driver, how this situation came about.”

Over the past weeks, there have been a number of protests against widespread restrictions to public life to slow the spread of the coronavirus in Germany. Last week, protesters were forbidden to gather in front of the Reichstag building, a couple of hundred yards away from Ms. Merkel’s building, because the authorities feared that they could hinder or endanger lawmakers and government workers.