BERLIN — Six men suspected of plotting a possible attack on the Berlin half-marathon on Sunday were detained by the police amid heightened security in Germany a day after a truck attack in the western city of Münster killed two people.

The authorities said on Sunday that the Münster attacker, a 48-year-old German citizen who turned a gun on himself after plowing into people at sidewalk tables, did not appear to be linked to Islamist terrorism or to hold any other political convictions.

But on a continent that has seen Islamic State supporters repeatedly turn vehicles into weapons to target civilians, the authorities remained on raised alert. In Berlin, roughly 630 officers were deployed along the marathon route.

The authorities said the six detained men had shown a suspicious level of interest in the race. “Ahead of the Berlin half-marathon there were scattered indications that the six detainees, aged 18 to 21, could have been involved in the plotting of a crime linked to this event,” the Berlin police and prosecutors said in a joint statement.