The case emerged when the retailer queried the standard VAT rating of its teacakes which it felt should be a zero-rated product.
While Customs officials agreed to the rating change, the amount of recoverable VAT was disputed.
In the first move of its kind, Customs invoked laws on un-just enrichment which prevents the government repaying VAT to companies if it means they would benefit unfairly because it is impossible to pass the recouped VAT back to the people who paid the tax originally.
Additionally, the introduction of a three-year cap on VAT repayments was introduced during the case which prevented Marks & Spencer from recovering the VAT it had paid on the teacakes.
The move was intended to limit the liability to the exchequer. A series of tribunal, High Court and then Court of Appeal hearings ended when the appeal court ruled against the retailer last month. M&S had argued that the VAT they were owed should be paid back promptly and the three-year cap was not very fair.
It is the first time Customs has successfully argued unjust enrichment.
The court ruled 90% of the VAT should be retained by the government.
A Customs spokesman said: ‘There is no way they could pass the money back to the public who bought the teacakes.’ Customs had never won such a case before.
The ruling capped a poor year for M&S, including its shock trading announcement in January 1999 and subsequent news that profits had been virtually halved to £655.7m for the year ending March 1999.
M&S could take its case to the House of Lords but it is waiting to learn the outcome over the referral of part of the case to the European court.
‘We are considering our position,’ said a spokesman.
Report argues that the government must change the way it makes tax and budget decisions
Drastically fewer offices for HMRC in the hope to reduce their running costs
Tayabali Tomlin and d&t directors launch £20 a month TaxGo service, aiming to be the 'biggest UK firm' by client numbers
Companies must report on their complex financial structures including offshore accounts and notify HMRC