A CASH-strapped Labour council has been scolded by one of the UK's most senior judges for "dancing on the head of a pin" with "Alice In Wonderland" legal arguments, which have cost taxpayers thousands of pounds.

Lord Wilson of Culworth, a justice at the UK's Supreme Court, made the scathing remarks last week as South Lanarkshire Council fought to keep potentially damning documents about pay a secret.

If it loses the case, the council's legal costs are expected to be around £200,000. South Lanarkshire recently warned 120 jobs were at risk in a £12 million cuts package.

In 2010, Scotland's Freedom of Information (FoI) Commissioner ordered the local authority to release details of its pay scales to equal pay campaigner Mark Irvine, who wanted to know if male and female manual workers with similar skills were on different wages.

In recent years, councils across Scotland have paid millions of pounds in compensation to female staff who were systematically underpaid. South Lanarkshire is currently fighting a £10m back pay claim from 1500 female staff.

South Lanarkshire appealed the FoI decision to Scotland's highest court, the Court of Session. It also ruled in Irvine's favour. But South Lanarkshire again refused to release the information, and last week it became the first public body in Scotland to appeal an FoI ruling all the way to the Supreme Court.

The Sunday Herald has now obtained a recording of the full proceedings.

The council argues that releasing the details could identify individual staff, breaching the Data Protection Act. But the act says the data can be disclosed if it is "necessary" for Irvine's legitimate interest.

The council spent most of its time at last Monday's one-day hearing arguing over the exact definition of "necessary", and whether it meant "essential" or not, and thus whether the council had to release the information or not.

Sarah Wolffe QC, said that from the council's perspective, "necessary" meant "more than facilitate or be convenient" but less than "absolutely necessary or strictly".

Lord Wilson interrupted to tell Wolffe: "This is becoming Alice In Wonderland - Alice Through The Looking Glass.

"You've spent almost two hours discussing the meaning of the word 'necessary' and you've been most nimbly dancing on the head of a pin."

Wolffe replied: "I hope the court wouldn't, wouldn't feel that, would regard the submissions that I have advanced as that kind of submission. I'm not a very good dancer."

A few moments later, Lady Hale, deputy president of the Supreme Court, told Wolffe: "I think you've had enough assault on this subject. Can we move on to the next point?"

The FoI Commissioner's counsel, Dean of the Faculty of Advocates Richard Keen, later argued that releasing the information was "proportionate".

Irvine said: "If South Lanarkshire loses its appeal, this may require the council leader, Eddie McAvoy, to consider his position. As in Alice In Wonderland, it may be time to say, 'Off with his head!'"

South Lanarkshire SNP councillor Peter Craig said: "Hiring big lawyers to put a case as weak as that is a waste of public money."

A South Lanarkshire Council spokeswoman said: "It would be inappropriate for any of the parties concerned to comment while the judges consider their judgment."

The Supreme Court is expected to deliver its verdict in the autumn.