Sweden has reacted with shock to the killing of a teacher and pupil at a school in the west of the country, near Gothenburg, by a sword-wielding man.
Police say the attacker, who was shot dead by police, is being investigated for possible far-right sympathies.
Investigator Thord Haraldsson said a racist motive was "part of the picture" but did not reveal further details.
Two others were critically injured in the attack at the school in Trollhattan on Thursday morning.
The attacker, 21, was seen posing for a photograph with students, who thought he was dressed for Halloween, before going on the rampage from classroom to classroom, sending panicked students fleeing from the school building.
A teacher and 17-year-old boy died from stab wounds, while another male student, 15, and 41-year-old teacher remain in serious condition in hospital.
The attacker's name has not yet been released by police, though they say he was local to Trollhattan.
Before visiting the scene of the attack, the Swedish prime minister said it was a "black day" for Sweden.
"School is supposed to be the place for learning, play and curiosity and friendship and therefore this is a tragedy that affects the whole country," Stefan Lofven told reporters.
King Carl Gustaf said he was "in shock" and that he had learned of the events in Trollhattan "with great dismay and sorrow".
Dozens of people gathered outside the school building on Thursday evening to pay their respects to the victims and place flowers and candles on the ground.
Some residents of the town who were holding a vigil held up posters that read "why kill?"
Swedish media reports say the suspect's accounts on Facebook and YouTube suggest he had an interest in Hitler and Nazi Germany, as well as hostility to Islam and immigration.
Haraldsson told reporters police had found "interesting" things at the suspect's home. He was not previously known to police, he added.
"He was a loner. He played video games, lived in his own world," a former classmate told Sweden's daily Expressen.
Eyewitnesses described scenes of chaos, with the attacker knocking on the doors of at least two classrooms and attacking two male students who opened them. One of the boys later succumbed to his injuries.
None of the victims have been identified by police.
Laith Alazze, 14, told Sweden's TV4 that one of his friends walked over to the assailant to challenge him "but when we saw he stabbed [the teacher], we ran away''.
Another student told the same station that the attacker, who was wearing a Darth Vadar-like mask and clad in black, "walked sort of like a soldier with a sword in his hand".
Police were alerted to the attack at around 10:10 local time (08:10 GMT) on Thursday, and later gunned down the attacker in the hallway outside a classroom.
The Kronan school that was attacked has about 400 students aged between six and 15, including many children of immigrants.
Trollhattan is an industrial town in west Sweden, located about 75km (50 miles) north of Gothenburg, the nation's second largest city.
School attacks are rare in Sweden - with just one incident on record in the past 20 years, in which one pupil was shot dead.