Police at the school after the attack. All photos: AFP
One 17-year-old pupil armed with a rifle, two handguns and two grenades was arrested after the shooting at the Tocqueville high school, a police source told AFP, asking not to be named.
There was initially conflicting information about whether a second suspect was involved, although police have since said the shooter acted alone.
Local official Christian Estrosi told AFP the shooting was “not at all” being seen as a terror attack.
Estrosi, president of the regional council, said the assailant may be suffering from “psychological problems”.
Media reports suggested the teen had researched the Columbine school shooting online, where 13 were killed during an attack in 1999.
Eight people were injured in Thursday's attack, one of whom was the headteacher, the interior ministry said.
The motive for the attack was still unknown.
Estrosi told France Info radio that the head teacher had been shot but apparently was not seriously injured.
“According to initial information that I have, we're not talking about an injury that could have life-threatening consequences,” he said.
Pupils at the school said they had hid under tables before “running for their lives”.
“I heard four shots, then there was total panic,” an 18-year-old witness named Andreas told BFM TV.
“We all started to run, we didn't know what was happening, and who was hurt. I have no idea what's going on in the head of the person who did this. I have no words.”
All schools in the town some 40 kilometres (25 miles) west of the Riviera resort of Nice have been locked down, education authorities said.
France is still in a state of emergency after a series of terror attacks including an Isis-claimed massacre in Paris in November 2015 in which 130 people died and a truck attack in Nice in July last year.
Authorities in the jittery nation have bolstered security outside schools.
More than 3,000 reservists were called up to help keep watch outside the country's 64,000 primary and secondary schools for the return to the school year in September.
The shooting comes less than six weeks ahead of a two-round presidential election on April 23 and May 7.
A crisis cell has been put in place, education official Emmanuel Ethis said on Twitter.
Ethis urged worried parents not to travel to the school, saying that “pupils are safe”.
The French government initiated an attack alert via smartphone in the wake of the shooting.
Local officials told AFP that several pupils had fled and sought refuge in a nearby supermarket “which created panic and rumours of an attack”.
“The other pupils have been asked to stay in the school and not panic,” local officials said.
Interior Minister Bernard Cazeneuve cut short a trip to the northern Somme area because of the Grasse shooting, as well as a letter bomb blast at the offices of the International Monetary Fund in Paris on Thursday.
The education minister was also on her way to the school.
France has had bitter experiences of attacks in schools.
In 2012, an extremist from Toulouse, Mohamed Merah, shot dead three children and a teacher at a Jewish school in his city before being killed by police.
Thursday's shooting came just hours after the letter bomb explosion at the IMF offices, injuring a secretary who suffered burns to her hands and face.