BERLIN — A 29-year-old man drove his car into a carnival parade in a German town on Monday, according to the police and prosecutors, injuring about 30 people, including children, and shaking a country already on edge after a racist shooting that killed several people last week.

The state prosecutor in Frankfurt said the authorities suspect that the driver, a German from the region where the crash took place, had deliberately steered his vehicle into the crowd of families with young children who had packed the streets for an annual Shrove Monday parade.

Germany’s top security official, Horst Seehofer, last week declared far-right extremism to be “the biggest threat to our democracy right now” and ordered an increased police presence at large public events.

Regional law-enforcement officials said, however, that they had no indication of a political motivation for the crash on Monday in the small town of Volkmarsen.