The humble chocolate teacake cost the Treasury £3.5 million today. That's the price of a VAT mistake which classified Marks & Spencer teacakes as chocolate biscuits.
Twenty years later HM Customs and Excise acknowledged the error and said teacakes are chocolate cakes after all - a crucial distinction because chocolate biscuits are subject to standard-rate VAT and chocolate cakes are zero-rated.
But by the time the error was corrected Marks & Spencer had handed over £3.5m in wrongly paid VAT on its teacake sales, and demanded the money back.
Today the European Court of Justice agreed that a teacake is a biscuit and confirmed that the Treasury should reimburse the retailer.
The 12-year legal battle began when the Commissioners of Customs and Excise acknowledged the error - but only offered £350,000 back on the grounds that 90% of the VAT had been passed on to Marks & Spencer customers: paying back the total sum would therefore mean "unjust enrichment" for the store.
In addition, the Commissioners invoked a three-year limit on claims for repayment - and ended up handing back just £88,440.
But the judges said today that traders were entitled to correct application of national VAT rules, and had a right to a refund of any VAT wrongly charged.
The verdict said EU rules did not in principle prevent HM Customs holding back some repayments if a full refund would mean "unjust enrichment" for a trader.
But because the "unjust enrichment" clause was applied differently to traders owing the Treasury money than to those owed money - contrary to EU rules on equal treatment, the clause could not be invoked in this case.
Tony McClenaghan, head of indirect tax at Deloitte, which acted for M&S, said: "This judgment entitles M&S to claim back £3.5m in overpaid VAT, bringing to an end an epic dispute after 12 years and two trips to the European Court of Justice. This is a sweet victory for M&S, for whom this was as much a matter of principle as about recovering the money."
VAT was introduced in the UK in 1973. Under the rules, "Chocolate covered products" were all classed as biscuits and not as cakes - even chocolate teacakes.
It was not until September 1994 that HM Customs acknowledged the error, despite another European legal case which had already ruled that Jaffa cakes were cakes and not, as they had been classified, biscuits.
At an earlier hearing last year, an Advocate-General at the European Court helpfully set out the VAT confusion which triggered the case: "In general, the supply of food is zero-rated for value added tax in the UK. Confectionery is an exception to such favourable tax treatment and is taxed at the full rate.
"There is an exception to that exception for cakes and biscuits, which are subject to the zero rate of tax applying to food.
"Biscuits wholly or partly covered with chocolate, however, are regarded as confectionery and taxed accordingly at the full rate".