A teen student who had troubled relations with his peers opened fire at a high school in southern France on Thursday, wounding three other students and the principal who tried to intervene, officials said.

Police moved into the Alexis de Tocqueville school in the town of Grasse — the country's picturesque perfume capital — and quickly arrested the armed suspect, identified by the interior ministry spokesperson as Killian Barbey.

At least three people were injured when they were shot and others were in shock. (Eric Gaillard/Reuters)

The government minister for victims' affairs, Juliette Meadel, told BFM television there were four people shot — three students and the high school principal — and 10 other victims.

The Grasse prosecutor said some of the victims were suffering from "emotional shock." None of the injuries was considered life-threatening.

Rifle, pistols, grenade

Prosecutor Fabienne Atzori said the young man — armed with a rifle, several pistols and a small grenade — entered a classroom then left, "not finding the person or people he was searching for."

"The motivation of the student appears linked to bad relations with other students in this high school in which it appears he had some difficulty integrating," Atzori said.

Students wrapped in emergency blankets wait outside the school. The French education minister said the shooting appeared to be the 'insane act of a fragile young man fascinated by weapons.' (Philippe Farjon/Associated Press)

The youth was not known to police and checks were being made to establish whether there were any accomplices and how he had acquired his weapons.

Atzori said there was no reason to suspect the shootings were terrorism-related. A national police official said earlier there did not appear to be any other suspects.

Principal 'courageously' intervenes

Officials variously gave 16 and 17 as the age of the suspect. His Facebook page indicates he is 16.

After the suspect started shooting, students alerted the principal, who was wounded while "courageously" intervening, the prosecutor said. Some students only discovered shrapnel in their bodies once home, she said.

French firefighters help an injured woman near the high school. A teen student has been arrested in connection with the shooting. (Eric Gaillard/Reuters)

Education Minister Najat Vallaud-Belkacem, who visited the school Thursday, called it "the crazy act of a fragile young man fascinated by firearms.... We just missed the worst."

The suspect's Facebook is filled with violent or gory images.

'Go hide!'

During the attack, some students hid at the school and others were evacuated from it. A police helicopter circled overhead in what is normally a relatively quiet corner of France.

Police cordoned off the area and worried residents gathered outside in the town, which is 40 kilometres from the southern city of Nice, site of last year's Bastille Day attack that killed 86 people.

The president of the region, Christian Estrosi, said the principal suffered an arm wound and told him that after being alerted to the presence of the armed student, "he tried to interpose … to try to calm him, and unfortunately he didn't succeed."

Grasse is about 40 kilometres from the southern French city of Nice. (Google)

Student Charlotte Camel, 18, told The Associated Press she was in the school library when "a teacher ran into the room shouting, 'There's someone with a gun, go hide!' That's what we did from the very beginning."

"We all very much panicked. I thought a lot about the other students in my class who were in class and I wondered if they were OK. I thought about my friends and the teachers too," Camel said.

State of emergency

The attack came amid France's state of emergency in response to a string of deadly Islamic extremist attacks over the past two years.

While no terrorism link has been identified, "all this justifies the state of emergency," President François Hollande said, adding that it would remain in place until July 15, as planned.

The French government sent out an alert warning of the attack at the school shortly after reports of the shooting emerged. (Associated Press)

The government sent out an alert warning of an attack after police reported that shots were fired, but later lifted it. The alert is part of a system implemented by the government after the deadly November 2015 attacks in Paris.

France has some of the strictest gun laws in the world. French citizens are banned from owning automatic weapons, while many other guns require government authorization and a medical exam, along with a permit from a hunting or sport shooting federation.

"This is reminiscent of the Columbine tragedy in the U.S.," Socialist presidential candidate Benoît Hamon told reporters, referring to the 1999 incident in which two students fatally shot a teacher and 12 classmates before killing themselves.