The head teacher at the Källskolan school was not seriously injured in the attack, according to a spokesman for Karolinska University Hospital.
Police dogs and helicopters were brought in to aid in the search for the perpetrator.
“We have begun a preliminary investigation into murder or attempted murder,” police spokesman Towe Hägg told TT.
The school’s deputy headmaster, Claes Bystedt, spoke to the principal before he was taken away in an ambulance.
“He said that he had been stabbed but his condition was stable when he left here,” Bystedt told TT.
“We were aware of a threat. The guy was here earlier in the week making threats,” he added.
According to the deputy headmaster, the attack took place in the staffroom and was witnessed by several teachers. The principal was stabbed seven or eight times in the back, he said.
The suspect is believed to be between the ages of 20 and 25 with connections to a former pupil at the school. But Bystedt said that the perpetrator had never attended the small private school, which has a Christian profile. The school is attended by 140 pupils aged from six to sixteen.
The principal was taken to Karolinska University Hospital to be treated for his injuries.
Police first received reports of a stabbing shortly before 1pm.
Police sealed off the crime scene and conducted searches on commuter trains in the area but did not succeed in locating the attacker. They did however find a knife that they believe may have been used in the attack.