The Elysee Palace confirmed the authenticity of a video circulating online in which Macron can be seen approaching a line of people, preparing to shake hands, when one person behind the barrier reaches out and slaps him, the dpa news agency reported.
The palace called it "an attempted slap". According to media reports, two people were detained in connection with the incident.
As the president is slapped, the words "Down with Macron-ism" are shouted, the BBC reported.
In the video, Macron is swarmed by security personnel after the assault. It is not clear whether he was injured or what happened to the people behind the fence.
The palace said Macron continued with his visit after the incident.
Prime Minister Jean Castex told the National Assembly shortly afterwards that while democracy meant debate and legitimate disagreement, "it must never in any case mean violence, verbal aggression and even less physical attack", the BBC reported.
Far-left leader Jean-Luc Melenchon tweeted his "solidarity with the President" immediately after the incident.