The teenager is suspected of preparing "a serious violent attack", murder, and having had "extreme Islamist views", according to the prosecutor in the federal state of Schleswig-Holstein in northern Germany.
The suspect, who is a German citizen, was arrested last week in the city of Elmshorn. According to the newspaper Bild, he planned to use a truck in the attack.
In December 2016, twelve people were killed when a hijacked truck drove straight into people at a Christmas market in Berlin.
Just like many other countries, Germany has recently raised the threat level regarding terrorist attacks. According to the authorities, several planned attacks have been thwarted recently.