It is a case of mistaken identity that has been occupying some of the finest legal brains in Europe. In the dock was an innocent looking chocolate teddy bear in a gold jacket which always turned up in court wearing a ribbon with a little heart charm round its neck and a big smile.

Looking on was a pack of gummy bears – less than 2cm tall and all wearing the same blank expression.

In the autumn German confectioner Haribo launched legal action accusing Swiss chocolatier Lindt & Sprüngli of copying its trademark on the Gold Bear name after it launched the gold foil-wrapped Lindt Teddy. Haribo, which invented gummy bears almost a century ago, said the two products would confuse shoppers – even though one is a jelly sweet and the other chocolate.

The normal Haribo gummy bear package features a cartoon bear wearing a red ribbon around its neck, while the Lindt product features a bear caricature printed on gold foil, with a real red ribbon wrapped around its neck.

On Tuesday a German regional court ruled in favour of Haribo and banned any future sales of the chocolate bears, which it said consumers referred to as Gold Bear because of the packaging. It was not clear if Lindt will appeal.