The Scottish Executive has failed with a landmark bid to block the release of highly sensitive documents explaining why Scotland's "closed shop" for legal services has never been opened up to competition.

A Court of Session ruling yesterday should force the disclosure of correspondence on the subject between senior politicians, lawyers and officials.

They include the late First Minister Donald Dewar, Deputy Prime Minister John Prescott and former Lord Chancellor, Lord Irvine of Lairg.

In a 26-page ruling, the Lord President, Lord Hamilton, together with Lord Nimmo Smith and Sir David Edward, dismissed the executive's arguments that certain documents were exempted from disclosure under the freedom of information legislation.

They made the same ruling in a second case in which the executive refused to disclose documents, requested by The Herald, concerning plans to dump waste in a protected Scottish quarry.

Both cases are a triumph for the Scottish information commissioner Kevin Dunion, who had ordered ministers to publish the documents.

Mr Dunion welcomed the decision, saying: "This is an important judgment in my favour. The court has agreed it was wrong of the executive to conclude that it would be harmful to release information which it characterised as belonging to a class or type - for example, advice to ministers - without regard to the content of that information. I have consistently maintained this is not what parliament intended."

The decision is also a victory for Bill Alexander, a longstanding campaigner for wider consumer access to legal services. Last year, Mr Alexander used freedom of information legislation to seek disclosure of ministerial correspondence and memoranda from the past decade concerning the enduring ban on people other than solicitors and advocates being paid to represent clients in the Scottish courts.

"I am pleased the law has been clarified. Hopefully, everyone can now move forward in getting greater access to justice for the people of Scotland," he said.