A gunman has opened fire on a train travelling from Amsterdam to Paris, injuring three people before being overpowered by passengers, French state rail company SNCF said.

Two of the victims were seriously injured and at least one suffered gunshot wounds, an SNCF spokesman said, adding that the assailant was armed with guns and knives.

Two American passengers reportedly overpowered the gunman.

The motives behind the attack were not immediately known.

The incident happened near Arras in northern France shortly after 5pm and the gunman was arrested when the train stopped at the town's station, an SNCF spokesman told AFP.

The man suspected of carrying out the attack is from Morocco or of Moroccan origin and is known to French intelligence services, a police source said.

The 26-year-old suspect was overpowered by two American passengers on the high-speed train and arrested when the train stopped in northern France.

Counter-terrorism investigators have launched a probe.

France remains on edge after Islamic extremists attacked the satirical magazine Charlie Hebdo and a Jewish supermarket in Paris in January.

In June, a man beheaded his boss and tried to blow up a gas plant in southern France in what prosecutors say was an attack