The man is said to be severely injured after he brandished the weapon while threatening security at Saint-Lazare station, one of the busiest stations in Paris.
The incident started after he was stopped for not wearing a mask and he refused to comply with officials.
He then took out his knife and charged towards them shouting pro-ISIS slogans before he was shot twice in the chest.
He is now in a life-threatening condition as he fights for his life in hospital.
France’s state-owned railway company SNCF said in a statement: ‘The two agents used their service weapon to defend and neutralise him.
‘The injured individual was taken care of by the emergency services.’