Two financial experts whose actions trying to save Rangers fell below an "ordinarily competent" standard have been ordered to pay £3.4m to the club's liquidators.
Judge Lord Tyre found David Whitehouse and Paul Clark breached their duties while acting as administrators at the club.
He ordered them to hand over £3,404,500 to financial services firm BDO.
The company won the sum following proceedings earlier this year.
Mr Whitehouse and Mr Clark - who were employed by financial services firm Duff & Phelps - were appointed by the Court of Session as administrators after HMRC took Rangers to court for £18m of unpaid tax in February 2012.
BDO's legal team told the judge both Mr Whitehouse and Mr Clark failed to cut costs sufficiently well enough after they were drafted in to save the business.
Advocate Kenny McBrearty QC said the pair could have made staff redundant and stopped the company that owned Rangers from being liquidated by making it more attractive to potential buyers.
Mr McBrearty also told the court that Mr Whitehouse and Mr Clark could have sold on players like Steven Naismith, Steven Whittaker, Maurice Edu and Kyle Lafferty.
He said they should have considered selling club assets like the Murray Park training ground as well as thinking about a deal which would have seen Ibrox stadium being sold and leased back to the club.
In a 125-page judgement issued at the Court of Session in Edinburgh, Lord Tyre agreed with the submissions made by Mr McBrearty.
Writing about the way Mr Whitehouse and Mr Clark considered redundancies, Lord Tyre said the men relied too much on a report which had been provided to them by manager Ally McCoist.
He wrote: "I address firstly the steps taken by the respondents to inform themselves of the factors relevant to their decision-making in relation to player and non-player redundancies and player sales.
"In my opinion the respondents' actings in this regard fell below the standard reasonably to be expected of an ordinarily competent administrator in a number of respects.
"I am satisfied that the respondents acted without having taken independent advice on certain critical matters about which they required to be informed."
Mr Whitehouse and Mr Clark went on to sell the business and assets of the old company that ran Rangers to Charles Green's consortium for £5.5m.
But just months later a judge approved a Duff and Phelps motion to hand over what remained of the old company to liquidators BDO.
Mr Whitehouse, Mr Clark and Mr Green were later among seven indicted over fraud allegations relating to Rangers - before the case against them was dropped in June 2016.
Both Mr Whitehouse and Mr Clark raised a multi-million pound action against the police and prosecutors last year.
Prosecutors admitted the case against them was "malicious" and conducted "without probable cause". They both received multi-million pound settlements.
Prosecutors also admitted that Mr Green, who was also arrested during the probe and eventually acquitted, was wrongfully taken to court - and that the prosecution against him was malicious.
Mr Whitehouse and Mr Clark's legal team had claimed that they did not want to sell players on, make redundancies, or sell assets as they feared these moves would put off potential buyers.
However, Lord Tyre rejected the claims.
Low bid
The judge also wrote that the administrators should have accepted a £1.7m bid made in April 2012 from West Bromwich Albion for Steven Naismith.
The court heard the administrators refused the bid on the basis that Naismith had a £2m buy-out clause in his contract and that the bid was too low to activate it.
But Lord Tyre concluded that Mr Whitehouse and Mr Clark acted incorrectly.
In the judgement, Lord Tyre broke down the £3,404,500 into four parts:
£977,500 for failing to sell on "marketable" players
£827,000 for failing to sell on Steven Naismith
£750,000 for failing to consider the "lease and sale" of Ibrox
£850,000 for the "loss of chance" of selling on Murray Park
Lord Tyre concluded: "I hold that the noters are entitled... to an order that the respondents contribute the following sum to the company's property by way of compensation for breach of duty."