Margaret Thatcher's energy secretary expressed fears too little was being spent on safety in the North Sea just two years before the Piper Alpha disaster.

Peter Walker warned of the need for offshore research adding "there are beginning to be indications that it may be difficult to continue to secure large contributions ...from the oil industry".

His comments were in contained in a letter dated May 29, 1986.

On the evening of July 6 two years later a total of 167 workers died off the coast of Aberdeen in the world's deadliest ever oil rig accident.

A report into the disaster by Lord Cullen found that the rig operator Occidental Petroleum had used inadequate safety and maintenance procedures.

At the time there were concerns that spending on the North Sea had been scaled back as the price of oil during the 1980s from $30 a barrel to just $8.

The newly released letter suggests that Mrs Thatcher's ministers shared those concerns as far back as 1986.

In the letter, Mr Walker wrote to John MacGregor, then the chief secretary to the Treasury, "the need for R&D (research and development ) into offshore safety remains, though there are beginning to be indications that it may be difficult to continue to secure large contributions to it from the oil industry.

"And it remains essential for the long-term health of the UK offshore supplies industry that my department join with them in R&D to help give them a technological 'edge'."

But, he adds: "Nevertheless, after taking all these factors into account, and having carefully reviewed my priorities, I can tell you I do not intend to seek net additional PES resources for my department over the survey period."

Tom Greatrex, Labour's shadow energy minister and the MP for Rutherglen and Hamilton West, said: "The Thatcher Government's decision not to pursue further investment into North Sea health and safety - just two years before this fatal tragedy - will be a distressing revelation to those who lost loved ones and colleagues on Piper Alpha.

"These revelations from the National Archive are an important reminder of the complacency about health and safety that was endemic in the North Sea prior to Piper Alpha.

"Health and Safety is vital - the thousands of men and women who work in challenging conditions in the North Sea must have full confidence in the systems that protect them. It is important that the attitude underlying this correspondence, and of the Government of the 1980s, are consigned forever to the past. The lessons of Piper Alpha are that safety should never be compromised, and when financial pressures on many operators are more acute because of the falling oil price, we must guard against corners being cut and safety compromised."

Piper Alpha had once been the UK's largest oil and gas platform.

Based 125 miles north-east of Aberdeen, on the evening of the disaster a series of series of explosions ripped through the platform.

The fire they sparked would eventually take three weeks to put out.