MI5 threatened to block Scotland's landmark freedom of information law over fears the legislation did not protect the UK's secrets, according to National Archives files.

Security Service officials are alleged to have said they could "arrange" for the Holyrood Act not to receive Royal Assent.

As a result, the previous Labour/Liberal Democrat Scottish Executive agreed to amend their plans after the row reached the UK Cabinet.

In 2001, MSPs passed a radical right-to-know law that gave citizens a legal entitlement to information held by hundreds of public bodies.

Exemptions were in place to protect sensitive material, but it was still more far-reaching than the UK Government equivalent.

However, National Archive files from the time the initial draft bill was being discussed in 2000 reveal a cross-border rift with British spies.

MI5 was concerned the restrictions did not go far enough.

In April 2001, an email between Scottish Executive officials stated: "Not good news ... The Security Services had been raising the prospect that an Order under ... the Scotland Act be arranged to preclude our Act receiving Royal Assent."

Such orders, possible under the legislation that created the Scottish Parliament, can block Acts from being rubber-stamped by the monarch.

One of the officials said there were suspicions that "Special Branch may be the source of the Security Service concerns".

The then Home Secretary Jack Straw wrote to the then Scottish Justice Minister Jim Wallace, saying he was concerned about the release of information directly relating to the intelligence agencies, and noted there was no ministerial veto for national security.

In response, officials said Wallace was "content in principle" to make adjustments. The Scottish Executive then made alterations which brought the Scottish Act more into line with the UK legislation.

The revelation has triggered a row about the SNP's approach to releasing the files of previous governments. Whereas UK Government files are subject to the "30-year" rule, First Minister Alex Salmond has slashed this to 15 years north of the Border.

However, the correspondence on the draft FoI bill is only about a decade old, and was given the OK for release by the Scottish Government.

Labour MSP James Kelly said: "It looks suspiciously like one rule for the SNP and another for everyone else. At a time the SNP are trying to stop extending freedom of information laws for current government decisions, they are willing to selectively release files from more recent administrations."

A Scottish Government spokesperson said: "This government is committed to openness and transparency – the key principle that underpins freedom of information legislation.

"More information than ever – including material from this and previous administrations – is now available for public viewing."