A French bakery has been ordered to remove "racist" chocolate cakes resembling caricatures with exaggerated genitalia from its windows, after a court in the French Riviera city of Nice deemed the pastries "an affront to human dignity, particularly that of African persons or persons of African descent."

The controversy surrounding the cakes kicked off in early March, when a horrified resident in the small town of Grasse reported the 4-inch tall, chocolate-coated "Gods" and "Goddesses" pastries in the windows of Yannick Tavolaro's bakery to the Representative Council of Black Associations of France (Conseil Représentatif des Associations Noires de France — CRAN).

The pastries, which depict a black man and woman with oversized genitalia, also feature "obscene and offensive slave trade caricatures, steeped in the old tradition of colonial racism," according to a statement from CRAN.

The anti-racism group immediately called for the removal of the "pompously-named" cakes via a press release, saying the pastries "ridiculed African religions" and harked back to the colonialist vision presented by the comic book Tintin in the Congo. The CRAN also noted the proximity of Tavolaro's bakery to several schools, and expressed concern over the fact that the baker is also the president of the local youth soccer league, "which includes many children from diverse backgrounds."

According to local daily Nice-Matin, customers flocked to the store after the CRAN issued its statement to get their hands on the pastry, which journalists described as, "a layer of crisp chocolate, garnished with a heavy chocolate mousse," sitting atop a crunchy biscuit base.

When no action was taken following their initial request, the anti-racism watchdog brought the matter to the mayor, eventually filing a petition for the "protection of fundamental liberties" against the quaint southeastern town of Grasse.

On Thursday the court banned baker Yannick Tavolaro from displaying the cakes in the window of his Grasse Delights bakery, in a ruling which does not affect his right to produce or sell the cakes. The court said Tavolaro had shown no malicious intent in making the pastries, which the baker said are produced and sold "only at the weekend."

The court also ordered the town's center-right mayor Jérôme Viaud to enforce the ruling immediately, in order to maintain law and order"= in the tourists town of Grasse. The town will incur a 500 Euro ($540) fine every day until the offending cakes are removed, and will pay CRAN a lump sum of 1,000 Euros ($1,080).

In a statement released after the ruling was announced, CRAN president Louis-Georges Tin said he welcomed the court's decision, adding that "anti-black racism is not a problem [that concerns] only black people. It is well and truly an affront to human dignity in general."

Tin also said that local officials had been complicit with the baker, and that the ruling served as a warning to all elected public officials. CRAN has also said that it reserves the right to sue the baker for inciting racial hatred, if the pastries are not removed.

Speaking to French daily Le Parisien in early March, Grasse's controversial baker argued that he had been making the pastries for 15 years, saying, "if they were racist, no one would order them." He added that "if they were white, no one would be offended."

Tavolaro, who claims that the black chocolate coating is nothing more than a necessary moulding technique, has now lodged his own complaint against CRAN, and is suing the racism watchdog for slander.

This is not the first time a French bakery has landed in hot water for making confectionery with colonialist and racist undertones. In September 2014, a pâtisserie in the city of Auxerre was ordered to change the name of two cakes called "Bamboula" — a highly-pejorative French term for an African man — and "Negro," following a joint complaint by the CRAN and anti-racism group Sortir du Colonialisme (Leaving Colonialism).

According to Le Parisien, the chocolatier had argued that the cakes — one a gingerbread, the other a chocolate biscuit — were metaphors for the courage and bravery of Senegalese riflemen who had fought for France in the late 1800s and early 1900s, and been treated in the local hospital.

CRAN president Louis-Georges Tin replied, saying, "black people in France would have happily dispensed with this type of tribute."

"What's next — "Kike" candy to pay tribute to the Jews who were deported [during the Holocaust]? Using these racist terms to sell a product is outrageous enough, but to say it's a tribute," he continued. "They must really think we're idiots."

France's pastry tradition has long fostered dubious pastry names, like the now-outlawed "tête-de-nègre" [n*****'s head], a chocolate-covered marshmallow, which is known in the US as a whippet.