PARIS (Reuters) - A teenager who slapped former French prime minister Manuel Valls during an election campaign trip to Brittany was handed a three-month suspended sentence and was ordered to carry out 105 hours of community service, a prosecutor said on Wednesday.

Valls, 54, was walking past a group of people in the town of Lamballe on Tuesday after coming out of the municipal office. He appeared to first shake hands with the young man before the latter shouted: “This is Brittany!” and reached out, gently slapping the ex-premier.

The 18-year-old accused admitted his guilt, enabling the judge to offer him a swift sentence and avoiding a potential trial, Bertrand Leclerc, a prosecutor in the northwestern town of Saint-Brieuc, told Reuters.

The youth was also asked to pay Valls a symbolic euro, he said.

Valls was campaigning for primary elections that will decide who will be the Left’s candidate in this year’s presidential election. Valls, a Socialist, is expected to be defeated in the second round of the election.

On Wednesday Valls said he would continue to campaign among the people and would not be “influenced” by the incident.