At least two people were injured in a shooting at a high school in the southern French town of Grasse on Thursday which saw the head teacher targeted, police and local authorities said.
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 conflicting information about whether a second suspect was on the run, with police initially telling AFP they were looking for an accomplice. Another police source said the shooter acted alone.
According to a statement from the Grasse town hall, "two pupils shot at the principal."
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 IS-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.
Employees were evacuated from the building near the Arc de Triomphe monument in the heart of the capital "as a precaution", a police source said.
IMF chief Christine Lagarde condemned it as a "cowardly act of violence".