Police officers control traffic near the Tocqueville high school in Grasse, France, where a student opened fire on March 16. (Valery Hache/AFP/Getty Images)

A heavily armed student opened fire and wounded four people Thursday at a high school in the southern French city of Grasse, officials said.

Six others were slightly injured in the clamor to escape the school building, officials said.

The student, whose identity was not released, was subsequently arrested, a spokesman for France’s National Police confirmed to The Washington Post.

An Interior Ministry spokesman, speaking on French television, said the suspect is a 17-year-old male student at the Lycée Alexis de Tocqueville in Grasse. He was in possession of a rifle, two handguns and two grenades when arrested, the spokesman said.

At a news conference late Thursday afternoon in Grasse, French Education Minister Najat Vallaud-Belkacem called the attack “the crazy action of a fragile young man fascinated by weapons.”

The Grasse prosecutor also told reporters that the suspect’s motivations “seem to be related to poor relationships with other students. It seemed to be difficult to integrate.”

Among the wounded was the “heroic” principal of the Lycée Tocqueville, who, according to Vallaud-Belkacem, rushed to the scene to try to reason with the student when he saw him pull a gun.

The four victims who suffered gunshot wounds were taken to hospitals, officials said.

Grasse is about 20 miles inland from the French Riviera.

Another student at Lycée Tocqueville, identified only as Benjamin, 16, told the Nice-Matin newspaper that the shooting occurred Thursday during the school’s lunch hour, just before 1 p.m.

“Around 12:40, I was sitting down, finishing eating,” he told the newspaper. “I heard this loud bang and then two more. I turned around, and I saw someone in the courtyard with a shotgun, shooting. He was firing on the windows of the classrooms overlooking the courtyard. When I saw that, I ran away.”

Interviewed on France’s BFM Television, Andréas, another student at the school, described a scene of “total panic” that began with four loud shots.

“We started running,” he said. “We would have thought we were in a film. In the hall, there were traces of blood.”

The suspect was of “European” origin, a spokesman for the National Police told The Post.

There was no immediate word of any link to Islamist terrorism. Christian Estrosi, president of the Provence-Alpes-Cote d’Azur administrative region, which includes Grasse, said Thursday’s shooting was “absolutely not” a terrorist attack.

According to a report in France’s Le Monde newspaper, which analyzed the suspect’s YouTube history, the young man appears to have harbored a particular fascination with the 1999 massacre at Columbine High School in Colorado, as well as a fondness for a violent video game, “Hatred,” produced by a Polish firm suspected of ties
to radical-right and neo-Nazi groups.

France, set for a highly contentious presidential election next month, has remained under a constant “state of emergency” after terrorist attacks claimed by the Islamic State group killed 130 people in Paris in November 2015.

One of the presidential candidates, Marine Le Pen, the leader of France’s far-right National Front, has run on a campaign that many have called xenophobic and Islamophobic. Le Pen — whose father, Jean-Marie Le Pen, has been convicted of Holocaust denial in French courts —has been quick to decry perceived security failures in the aftermath of every recent attack perpetrated by Islamic State operatives or sympathizers. But she was silent Thursday afternoon, when no such connection could be established to a terrorist of Muslim background.

By contrast, rival Emmanuel Macron, the increasingly popular centrist candidate, tweeted his “thoughts for the injured and respect for the efficiency of the authorities, as well as the calm of the teaching staff” at the school.

In a separate incident Thursday, a letter bomb exploded in the Paris ­offices of the International Monetary Fund. The employee who opened the letter was wounded in the hand and face, police said.

Christine Lagarde, the French director of the Washington-based IMF, condemned what she called a “cowardly act of violence against” her staff.

French President François Hollande has been frequently criticized for the country’s perpetual “state of emergency” by both the right and the left. Conservatives often insist that the precautions have failed to prevent attacks, such as the July assault on the Riviera city of Nice, while liberals often say the state of emergency has led to many violations of civil liberties, especially for French Muslims.

On Thursday afternoon, Hollande — a Socialist whose historic unpopularity precluded him from standing for reelection this year — defended the state of emergency, insisting it should be extended through July 15.

“It will be up to my successor to decide what he will do next,” Hollande said. “But for now, the state of emergency is adapted to a certain number of risks.”