Some of the biggest names in the insurance industry had challenged the law which came into force in Scotland last June.

But Court of Session judge Lord Emslie rejected their legal challenge.

His written ruling concluded: "There is clearly room for differences of opinion as to whether the Parliament was right to legislate in the way it did, and it remains to be seen whether the 2009 Act will prove to have adverse legal or political consequences in years to come."

But the judge said he does not accept that the insurers' complaints come anywhere near the standard of "irrationality" needed to invalidate an Act of the Scottish Parliament.

The legal battle centred on a condition known as “pleural plaques”, which are changes in the layers of tissue which lie between the lungs.

The changes can be caused by past exposure to asbestos but have no symptoms or ill-effects and are not considered a disease in their own right.

The new law in Scotland was intended to reverse the effect of a landmark House of Lords ruling that people with pleural plaques could not seek compensation.

But insurers opposed the move, and the action to overturn the new law was raised by Axa, Norwich Union, Royal & Sun Alliance and Zurich Insurance.

When the legislation was going through Holyrood insurers argued that the new law ignored medical opinion and underestimated the cost of potential claims.

At the start of the court battle in May last year they argued the new law broke the essential legal principle of “proof of damage” and resulted from an “unreasonable, irrational and arbitrary” exercise by legislators.

The insurance companies argued that the law breaks European Convention on Human Rights provisions on property rights and unreasonable legal interference, that it will benefit a small group of people who had suffered no legal harm and that it will cost insurers hundreds of millions of pounds, or more, by retrospectively changing insurance contracts.

But their challenge was contested by Scottish ministers and by some people with pleural plaques.

They argued the insurers’ challenge was wrong in law, and that it did not fall within the permitted grounds of challenge to Holyrood legislation set out in the Scotland Act.

They also argued that it was the place of insurers to launch the challenge, as the damages claims would actually be brought against negligent former employers and the insurers would be affected only indirectly.

In his ruling Lord Emslie upheld two of the insurers’ legal arguments: on whether they had a close enough connection to mount a legal challenge, and on whether to challenge an Act of the Scottish Parliament on common law grounds of “irrationality” is valid.

But he still rejected the overall challenge.

Labour MSPs welcomed the ruling.

Member for North East Scotland Richard Baker said: “This is the right judgment and reflects the fact that this move by insurance companies to overturn the will of the Scottish Parliament was both unfounded and unjust.

“Most importantly this is good news for all those in Scotland who have had to suffer the trauma of being told they have pleural plaques and will now be able to pursue damages as they were previously able to do so.”

Asbestos campaigners welcomed the ruling.

Their lawyers called on the insurance industry to accept defeat and pay up.

Solicitor-advocate Frank Maguire said: “This judgment states categorically that the Scottish Parliament was perfectly within its rights to pass this law and that is tremendous news for pleural plaques sufferers.

“We have almost 1,000 pleural plaques cases which have been in limbo while the insurance industry pursued this ill-fated legal action.

“I now call on them to stop obstructing justice and not to try and put any more barriers in the way of victims seeking compensation.”

Mr Maguire said many insurance companies not involved in the court battle, as well as the Ministry of Defence and British Shipbuilders, had been holding back on settling pleural plaques cases.

“They also should now meet their obligations and pay up,” he said.

“The Westminster Government should now enact similar legislation for the rest of the UK.”

Harold McCluskey, chairman of Clydebank Action On Asbestos, said: “This is great news for the victims of pleural plaques.

“It is absolute rubbish to say that pleural plaques doesn’t affect victims. It’s as dangerous as any other asbestos-related disease.

“Most sufferers have some form of breathlessness but the biggest strain is the worry of developing into fatal conditions like mesothelioma which happens with frightening regularity.”

Former shipyard worker Dan O’Malley, 71, from Paisley, said: “I’m delighted the judge has ruled that the Scottish Parliament was right to pass this law.

“I was diagnosed with pleural plaques after suffering breathlessness and a persistent cough. I had all sorts of x-rays and finally a CT scan before pleural plaques was confirmed.

“Now it preys on my mind all the time especially since a very close friend of mine who had pleural plaques died of mesothelioma last year.”