The gunman was among the 11 people killed in the worst shooting in the history of Sweden at an adult education centre west of Stockholm.
On Tuesday, police received reports of a shooting in Orebro, a city 200km (124 miles) west of Stockholm, at 12.33pm local time and engaged in an exchange of bullets with the suspect.
Terrified students scrambled for cover under the desk and some even barricaded themselves in classrooms. The suspected perpetrator was later found with a gunshot wound, police said.
Five people were in “serious” condition in hospitals following the Risbergska School shooting, Orebro officials said on Wednesday morning.
Three women and two men, all over 18 years old, were operated on after being admitted with gunshot wounds. All are in stable but serious condition in the Orebro University Hospital.
By early Wednesday, details about the shooting and the suspect remained unclear as Sweden – where school shootings are extremely rare – grappled with the aftermath of the attack.
The bloodshed was so severe that police initially struggled to determine the number of victims amid the carnage.
Police said the suspect who has not been identified is believed to have shot himself, reported the Sweden Herald.
Orebro’s police chief Roberto Eid Forest said that the attacker acted alone and wasn’t known to police before the shootout. He also had no connection to a gang, he said.
"At the moment we are confident that no more attacks will occur. The schools that were occupied have been evacuated," police chief Forest said, according to public broadcaster SVT.
"We're working with secret services but as far as I know, it's a person unknown to police," said Mr Forest, when he was asked if the shooter lived in Orebro.
He added that police "can't say anything about the kind of weapon" that was used during the attack "other than it was a firearm".
The daily tabloid Aftonbladet, citing relatives of the suspected shooter, described him as a recluse who had maintained little contact with his family for years.
Swedish broadcaster SVT, citing unnamed sources, reported that the attacker held a hunting licence, like many in Sweden, and used a hunting weapon during the shooting.
Following the attack, the police conducted a large-scale search operation at a residence in Orebro believed to be linked to the suspect.
The search operation was extensive, with heavily armed officers deployed at the scene and drones used to inspect the apartment through its windows.
The snipers, meanwhile, took positions on nearby rooftops and by 5pm local time initial phase of the operation had concluded, and cordons were lifted.
However, officers at the scene declined to answer questions from local residents or specify how long the operation would continue.
All government buildings and royal palaces in Sweden will fly flags at half-mast from 9am Wednesday to commemorate the shooting, said press secretary to the prime minister of Sweden Tom Samuelsson.
On Wednesday, the Swedish police warned people against "erroneous narratives" that were being spread on social media regarding the mass shooting.
"We want to be clear that based on investigative and intelligence information at present, there is no information pointing to the culprit acting on ideological motives," police said in a brief statement on its website.