Who was the attacker?
The suspect has been named in the French media as 16-year-old Killian B, who is a pupil at the Alexis de Tocqueville high school in the southern town of Grasse, where he opened fire.
He was not previously known to police and appears to have acted alone, despite initial reports of a second attacker on the loose.
He was armed with a rifle, two handguns and two grenades, although it is not clear whether all the weapons were operational, including the grenades.
The head of the regional government, Christian Estrosi, said that early indications pointed to someone with “psychological problems”.
According to reports the suspect had created a playlist on YouTube which included videos focusing on the 1999 Columbine school massacre in the United States when two pupils gunned down 12 fellow students and a teacher.
It appears he had an obsession with the American high school massacre as he also posted a video surveillance image of the two Columbine killers on his Facebook page.
On his Facebook page, which is partly open to the public, the suspect also published numerous “satanist” images of characters with guns.
He also uploaded a video of himself wearing a horror clown mask holding a gun to his head, giving the impression he was fixated with guns, violence and death.
Local prosecutor Fabienne Atzori said the shooting appeared to have been motivated by the gunman's “bad relationships” with classmates.
The teenager was described by Education Minister Najaf Vallaud-Belkacem as “unstable and fascinated by guns”.
A school caretaker who had spoken to the pupil and tried to intervene said the suspect spoke of how he “not finished his mission, his contract.
“He said 'I have not caused enough damage',” said the caretaker.
His cover picture on Facebook features an image of The Joker from Batman with the quote: “Give the man a mask and he'll become his true self” and his profile picture is an image from a video game Hatred, described “as the most violent in the world”.
One of his friends posted a comment below one picture noting how he “only posted gory photos”.
A fellow pupil quoted in the French press said he had the “face of an angel” while another said “he was known for watching weird videos”.
Reports in the French press said his father was an elected councillor in Grasse.
Was this a terror attack?
It is this image of a troubled youngster that quickly persuaded authorities to dismiss the idea the shooting was a terrorist attack, even though that was what was initially feared.
Regional president Christian Estrosi said they are “not at all” treating it as a terror attack at this stage.
But it's perhaps understandable that the French government immediately triggered its terror attack alert app given the country is still on high alert after a string of attacks by jihadists since January 2015 that has claimed around 230 lives.
Security was bolstered around schools for the new school year in September and more than 3,000 reservists were called up.
Who was hurt?
The head teacher and two others suffered gunshot wounds. Another five people were injured during a stampede following the shooting, according to a statement from the interior ministry.
Estrosi said the head teacher's injuries were not life threatening. He said the headteacher had got involved to try to prevent the shooting when he heard the pupil had pulled out weapons.
He was apparently shot as he tried to calm things down rather than being the target of the attack was was earlier suggested.
There was panic at the school as some pupils escaped to a local supermarket and rumours spread quickly of an attack.
What was the response?
Schools in the town were immediately placed on lockdown and a smartphone application was triggered to warn people to stay away.
Terrified parents were also warned not to approach the school as elite special forces moved in to secure the area.
Prime Minister Bernard Cazeneuve broke off a visit to northern France and set off towards the scene in a helicopter.
Education Minister Najat Vallaud-Belkacem also said she was heading immediately to the school.
Where did it take place?
The Alexis de Tocqueville school has a good reputation and specialises in scientific courses.
Grasse, just 40 kilometres (25 miles) from the French Riviera resort of Nice, is a quiet hillside town with a population of some 50,000 is famous for its perfume industry.