Three teenagers have gone on trial in Germany over an explosion at a Sikh temple in the western city of Essen.

Prosecutors say the defendants, who are German-born Muslims, met on social media where they became radicalized and hatched a plan to kill people they considered to be "infidels."

In a statement ahead of Wednesday's trial, prosecutors said two defendants, a 16 and 17-year-old, are accused of detonating a fire extinguisher filled with explosives at the entrance of the temple on April 16.

One person was seriously injured and two people suffered minor injuries.

Another 17-year-old defendant is accused of planning the attack.

The teens are charged with attempted murder and serious bodily harm. Their names weren't published and media were excluded from the trial because the defendants are minors.