Former footballer Neil McCann has lost a £200,000 battle with the taxman over his work as a TV pundit.
The ex-Scotland and Rangers star, 47, had moved into commentary work when he hung up his boots.
His personal company, McCann Media Ltd, entered into agreements with broadcasting giant Sky and he carried out roles as a commentator, presenter or interviewer for football programmes or videos.
But HMRC challenged McCann's set up and claimed he owed thousands in unpaid income tax and National Insurance payments covering 2013-2018.
A tax tribunal was told McCann insisted he was not a Sky employee and he had other working commitments.
McCann said he could decline work with the broadcaster and pointed out he would be liable for any fines imposed by watchdog Ofcom in the event of a breach of rules.
But he now faces a substantial bill after the tribunal ruled his arrangements with Sky could not be considered an independent business.
The panel found McCann had to work within the agreed format of any programme and had restrictions on his non-Sky work.
Tax expert Dave Chaplin said McCann had fallen foul of IR35 rules on off-payroll employees.
He wrote in a blog: "The tribunal regarded him as a credible witness and none of the evidence suggested he sought to avoid tax and neither did HMRC seek to impose any penalties.
"It would be a considerable stretch of the imagination to suggest they and Sky had somehow contrived a situation to obtain a tax advantage.
"There was no finding as such by the judge, nor were the contracts deemed to be a sham."
He added: "Had those contracts been more carefully drafted to align with the relationship McCann believed he entered into, the decision may have been different.
"It's difficult not to feel sympathy for the position he has now found himself in."
McCann's career started with Dundee before he moved to Hearts who he helped win the Scottish Cup in 1998.
Later that year he signed for Rangers in a £2million deal.
He enjoyed success at Ibrox and later moved to Southampton.
McCann, who was capped 26 times for Scotland, returned to Hearts in 2006 before quitting football on his return to Dundee.
He is now a BBC Scotland pundit.
An HMRC spokesman said: "We welcome this judgement, which agreed that the off-payroll working rules applied.
"These rules are in place to ensure that people who work like employees, but through their own limited company, are taxed like employees, creating a level playing field with other workers."
McCann was approached for comment.
Last month TV presenter Adrian Chiles won a £1.7million IR35 case after a seven-year battle with HMRC.
HMRC argued that his BBC and ITV contracts fell inside legislation and he should pay thousands in back tax.
However, a tribunal ruled Chiles' work contracts were for services and not contracts of employment.
Don't miss the latest news from around Scotland and beyond - Sign up to our daily newsletter here .