Rangers have successfully appealed against a 12-month transfer embargo after contesting the Scottish Football Association's ruling in court.
Lord Glennie considered the arguments of the club and the SFA after a three-hour hearing at the Court of Session in Edinburgh before ruling that the SFA had "no right" to issue the ban.
The matter will now be referred back to the governing body's appeals tribunal for a new hearing.
Rangers were hit with the transfer ban, the first of its kind in Scottish football, for bringing the game into disrepute after failing to pay £13 million in taxes last season, and lost their first appeal with the SFA last week.
The conventional next step for Rangers would have been to take their case to the Court of Arbitration for Sport in Switzerland, but instead the club turned to legal action, which is prohibited under FIFA rules.
Rangers argued that the sanction was an unlawful punishment as it had not been an available option to the SFA panel that imposed it, specifically a ban preventing the club from registering any players aged 18 and over.
The SFA disputed that claim, arguing that it exercised a clause included in their rules that a judicial panel can implement any sanctions it deems appropriate, and also questioned whether the court had jurisdiction over a footballing matter.
The panel stated that the club's actions were second only to match-fixing in their seriousness and that it had considered expelling or suspending Rangers from the SFA before opting for the transfer embargo, a decision upheld on appeal by serving judge Lord Carloway.
Meanwhile, administrators Duff and Phelps remain upbeat about their chances of handing Rangers over to Charles Green's consortium after sending a pence-in-the-pound proposal to the club's creditors in a bid to exit administration.
If the Company Voluntary Arrangement proposals are agreed at a meeting on June 14, Rangers could exit administration within a month, but the success of that meeting is largely dependant on the result of a HMRC tribunal.
Rangers' debts are estimated to be between £55 million and £135 million, with an investigation into the club's tax affairs ongoing.