Police investigations indicated that the shots had come from a flat in a residential block close to the Johann Gottfried Borlach school in the small town of Artern, where a 21-year-old female tenant and two men were promptly arrested.
The main suspect was one of the two men, a 24-year-old police had already been searching for in connection with a weapons-related offence. Police were unable to find a gun in the woman's flat, though they are still searching the 24-year-old's home.
The four children, aged around 10 and 11, were hit in the neck and stomach but were not seriously injured by the shots, which were fired into two classrooms around midday. "They are mainly bruises, not open wounds," a police spokeswoman said.
Police praised the teachers in both classrooms for moving the children into other rooms as quickly as possible.
The school said lessons would continue as normal on Wednesday.