The principal and three students were physically injured in the shooting, according to Education Minister Najat Vallaud-Belkacem. Several others were taken to a hospital for treatment of minor injuries and counseling, she said.
The student, armed with a rifle, a handgun, a revolver and two grenades, entered the Alexis de Tocqueville school at about lunchtime and opened fire at the head teacher, CNN's French affiliate BFMTV reported.
The shooting was an "act of madness by an unstable young man fascinated by weapons," Vallaud-Belkacem said.
The mayor of Grasse, Jérôme Viaud, told reporters that he knew the family of the young man.
"This is a very difficult moment for the city of Grasse," Viaud said.
The pupil arrested wasn't known to police, the spokesman said. Authorities said the attack was not considered a terrorism incident.
Interior Minister Bruno Le Roux said an investigation had been opened into the incident and that the student was being questioned. He praised the response of staff at the school, saying they had acted quickly to protect students and alert security forces.
A student named as Andreas, interviewed on BFMTV, described a scene of chaos and said someone he knew had suffered a hand injury.
"I heard four shots. It was a complete panic. We went up to be safe. It was like being in a movie. We are not used to that," he said. "We hear stuff going on in Paris but now we understand."
Student Chiara L. Besson tweeted that she was in a classroom at the school when the gunfire broke out and that it had lasted between five and 10 minutes.
She said she, her classmates and their teacher had all got out without injuries and that the school had been evacuated.
The Interior Ministry tweeted that the elite police operations unit and bomb squad had now finished their work but a security cordon would remain in place around the school while the investigation continued.
The French education ministry tweeted that schools in Grasse were no longer under lockdown except for the Alexis de Tocqueville high school. Parents had been asked to stay away and not to try to pick up their children.
An investigation has also been opened into a separate incident Thursday, Le Roux said, in which an employee of the International Monetary Fund was injured in an explosion
at the group's offices in Paris.