The incident happened at the Lloyd Gymnasium school in the centre of Bremerhaven, a city on Germany’s North Sea coast, on Thursday morning.
“The armed person has been arrested and is in police custody,” police said in a statement. The injured woman was not a pupil, police said.
They said the suspect had entered the school building and fired at a female member of staff, who was “seriously injured”.
The alarm was quickly raised and police said they detained the suspect at a nearby location soon after and had seized his weapon at the scene.
The injured woman is being treated in hospital.
A video circulating on social media and German news sites appeared to capture the moment the gunman was arrested.
A man dressed in black is seen lying face down on a street corner, with a weapon next to him, before being handcuffed by officers.
But there was no immediate confirmation of reports the alleged weapon was a crossbow.
Bremerhaven police tweeted in the morning that a large deployment was under way in the city centre and asked residents to avoid the Mayor-Martin-Donandt square and surrounding streets, in the vicinity of the Lloyd secondary school.
Bitte meiden Sie den Bgm.-Martin-Donandt-Platz und die anliegenden Straßen. pic.twitter.com/rdLy1odfzi
— Polizei Bremerhaven (@PolizeiBhv) May 19, 2022
Local news site Nord24 said a school pupil had heard shots being fired and called the police. Pupils barricaded themselves in their classrooms.
Police launched a large-scale operation and cordoned off the area around the school while they carried out inquiries.
By mid-afternoon, police said special forces had completed their search and the last people had left the building.
Authorities set up a phone hotline for concerned parents. Many parents had gathered in front of the school after being alerted by their children.
Pupils and staff are receiving psychological counselling.
Local media said only around 200 people were on the school grounds, fewer than normal because of exam times.
In a separate incident on Thursday, police in the eastern city of Leipzig said they had detained a 21-year-old student still at secondary school after being tipped off by Snapchat that he had posted pictures of himself with a gun and made unspecified threats.
The US social media platform alerted German authorities, prompting Leipzig police to take action.
A police spokesman said that the 21-year-old did not pose a real threat, however, and only possessed an airsoft gun, a replica firearm that uses non-lethal, usually plastic, pellets.
‘Strict gun laws’
School shootings are relatively rare in Germany, a country with some of the strictest gun laws in Europe. But a recent spate has rattled the population.
Last week, investigators in Germany’s city of Essen said they foiled a school bomb assault, as they arrested a 16-year-old who is suspected to have been planning a “Nazi terror attack”.
Police in Essen stormed the teen’s room overnight, taking him into custody and uncovering 16 “pipe bombs”, as well as anti-Semitic and anti-Muslim material.
In January, an 18-year-old student opened fire in a lecture hall at Heidelberg University in southwestern Germany, killing a young woman and
injuring three others before fleeing the scene and turning the weapon on himself.
In 2009, a former pupil killed nine students, three teachers and three passers-by in a school shooting at Winnenden, in the German state of Baden-Württemberg. The gunman then killed himself.
In 2002, a 19-year-old former student, apparently in revenge for having been expelled, shot dead 16 people including 12 teachers and two students at a school in the central German city of Erfurt. He too then killed himself.
The Winnenden and Erfurt massacres were carried out with legal weapons and spurred Germany to tighten gun laws.
The country currently requires anyone under 25 to pass a psychiatric exam before applying for a gun licence.