SNP ministers will take the guardian of the public's right to scrutinise the Government to court in a dispute over Scotland's future in Europe.
Ministers are said to be spending £100,000 to defend their claim that they do not have to tell the public whether they took legal advice on an independent Scotland's future in the European Union.
The SNP insists Scotland will automatically be accepted into the EU, while opponents say it would have to reapply and lose the UK's existing rights and opt-outs.
Information Commissioner Rosemary Agnew ruled that ministers must tell the public whether they have taken legal advice on the matter. Ministers argue the public does not have the right to know and are taking the commissioner to court in an attempt to prove it.
Lawyers for both parties will appear before the Court of Session in Edinburgh on Thursday.
The commissioner's counsel will ask the court for an "urgent disposal" of the case, arguing that it is time-sensitive.
First Minister Alex Salmond has urged the Scottish people to wait for the publication of his Referendum White Paper in over a year's time. He said it will contain a position on the EU that will be "fully consistent and informed by the legal advice that (ministers) receive".
He has argued that to confirm or deny whether legal advice on the EU currently exists would put him in breach of the ministerial code which protects confidentiality of communications with legal advisers.
But the code also urges ministers to consider the public interest in maintaining this confidentiality, and suggests that publication may be appropriate "in highly compelling cases".
Speaking in Parliament last week, Labour leader Johann Lamont said: "I am not sure who the First Minister imagines would refer him under the ministerial code, in relation to giving us information that it is costing the state £100,000 to keep away from us."