A former local election candidate for the far-right Front National (FN) in France has been sentenced to nine months in prison for comparing the country's justice minister, who is black, to an ape.

Anne-Sophie Leclere provoked a storm last year when she compared Christiane Taubira to an ape on French television and posted a photomontage on Facebook that showed the justice minister, who is from French Guiana, alongside a baby chimpanzee. The caption under the baby ape said "At 18 months", and the one below Taubira's photograph read "Now".

Leclere was an FN candidate in Rethel, in the eastern Ardennes region, for the 2014 local elections, but the FN soon dropped her and went on to do well in the March polls.

On Tuesday, a court in Cayenne, French Guiana's capital, sentenced her to nine months in jail, banned her from standing for election for five years, and imposed a €50,000 (£39,500) fine. French Guiana is an overseas département of France and is inside the European Union. It also handed the FN a €30,000 fine, putting an end to a case brought by French Guiana's Walwari political party, founded by Taubira.

The court went well beyond the demands of prosecutors, who had asked for a four-month jail sentence and a €5,000 fine.

Leclere, who was not present in the court, said that she would appeal. The FN said it would also appeal, denouncing the sentences as "appalling" and criticising the trial as a "trap", as the party was unable to find a lawyer in Cayenne to defend it.

In a television appearance last year, Leclere said she would prefer to see Taubira "in a tree swinging from the branches rather than in government".

"She is wild," Leclere said, adding: "I have black friends and it doesn't mean I call them monkeys."

Leclere has since defended her comments, saying that while clumsy, they were not racist. She said the photo montage was a joke, and added: "The photo was posted on my Facebook page and I took it off a few days later. I was not the creator of this photograph."

Taubira has been on the receiving end of several racial slurs over the past year. Not long after Leclere's comments, the far-right weekly newspaper Minute published a cover featuring a picture of Taubira and headlines that read: "Crafty as a monkey" and "Taubira gets her banana back".

In French, getting your banana back is roughly the equivalent of recovering the spring in your step.

Joel Pied, of Walwari, said Tuesday's court decision was "historic and beneficial". He said: "A prominent institution of the republic recognises that the Front National is punishable by law and that it's a racist party. We hope this decision will mark a milestone."