At least two girls have been seriously wounded and a 16-year-old suspect arrested after an attack at a secondary school in the southern German state of Bavaria on Wednesday.

The perpetrator appeared to have deliberately targeted the Welfen grammar school in the town of Schongau in a suspected "rampage," a police spokesperson told the AFP news agency.

She was unable to confirm press reports which claimed the assailant used a knife in the attack.

Local police said on their X account that "a suspected perpetrator has been arrested," later adding that this was a "16-year-old boy."

Initially the police had spoken of "several" injured and later on Wednesday afternoon said that "according to current information two girls have been seriously injured."