A medieval combat enthusiast has been given four months in jail after he admitted slapping French President Emmanuel Macron.
Damien Tarel told the court it was an act of impulse, but the prosecutor said it was a "deliberate act of violence".
The court heard that Tarel subscribed to right-wing or far-right politics and was close to the yellow-vest movement.
President Macron said the attack should not be trivialised but had to be kept in proportion.
He had just left a hotel school in the south-eastern town of Tain-l'Hermitage when he ran towards a crowd waiting behind a metal barrier.
As he slapped the president, Tarel was heard to shout "Montjoie and Saint-Denis! Down with Macronism", using an obscure medieval battle-cry.
The incident was immediately condemned across France's political spectrum, less than a year before presidential elections.
Prosecutors had called for 18 months in prison for assaulting a public official. The three judges said Tarel should be given 18 months, with 14 months of the sentence suspended. His four months in jail will start immediately but the rest will only be enforced if he commits another offence.
A second suspect who filmed the incident is facing prosecution for illegal possession of weapons after local authorities searched his home. He comes from the same town as Damien Tarel.
What did Tarel tell the court?
According to AFP news agency, the defendant appeared in court in Valence wearing the same green T-shirt he wore on the day of his arrest.
Asked why he had attacked the president, he replied that while waiting with his friends in the car beforehand he had considered doing something notable. He had earlier considered throwing an egg or cream tart, but insisted he had not considered slapping Mr Macron.
"When I saw his friendly, lying look, which sought me out as a voter, I was filled with disgust," he was reported as saying to the court.
Condemning the president's politics, he added that he felt he was part of the anti-establishment gilets jaunes (yellow-vests) movement, which staged anti-Macron protests during the early years of his presidency. "I acted instinctively," he claimed.
Friends had earlier described Tarel as apolitical and Le Parisien had quoted one source who summed up his politics as "ideological mush". His Instagram page described him as a historic European martial arts enthusiast, complete with sword and armour.
His battle-cry is perhaps better known nowadays for its use in a 1993 French comedy film called Les Visiteurs.
What Macron says
The French president had earlier dismissed the assault as isolated, while emphasising that "ultra-violent people" should not be allowed to hijack public debate.
In a news conference on Thursday ahead of France's involvement in the European football championships, he went further.
"There have been moments of very high tension and violence in our country which I've had to experience as president, during the gilets jaunes crisis. But society is in a different place today."
He said he had decided not to take legal action himself, preferring to leave it to the judicial system.