The man sustained light injuries and was admitted to the Sahlgrenska Hospital.
On Saturday morning, police had made no arrests but were treating the incident as attempted murder or attempted manslaughter after receiving around 30 calls from the public.
At least one cartridge case was found and witnesses said they saw men carrying rifles, sub-machine-guns and batons.
Around 50 people, most of them youths, were present at the school yard where the shooting took place. According to witnesses, they rushed from the scene as between three and seven gunshots were fired.
Police said there may be a link between the shooting and a robbery on the nearby square Hammarkulletorget on Friday afternoon where a number of people were seen carrying batons.
“We cannot rule out a connection between the shooting and the attempted robbery,” regional police spokesman Christer Fuxborg said.
However, one local resident told the newspaper Göteborgs-Posten (GP) that the incident was not a robbery but an assault on a “Somali man who was beaten up for no reason”.
There was a heavy police presence in the area on Saturday with Fuxborg describing the situation there as “troubled”.
“Creating a sense of safety has historically been seen to have a calming effect and that is what we are trying to achieve today,” Fuxborg told news agency TT.
The school, called Hammarkullsskolan, is located in the Angered area of Gothenburg.