Forty years ago today, when General Augusto Pinochet overthrew Salvador Allende, the elected president of Chile, democrats across the world were horrified. But not the British Foreign Office. Declassified government documents show British diplomats reserved their harshest criticism for human rights campaigners and journalists trying to alert the world to the "disappearance" and torture of thousands of Chileans. The head of the Foreign Office's Latin America department complained:

"Chileans must be wondering why on earth so much unfair attention is being paid to their change of government. The answer is that Chile is now being subjected to the full treatment by an international front organisation, the Chile Solidarity Movement. Chile has been chosen by the organised left as a new crusade."

Intelligence officers were sent to infiltrate the Chile Solidarity Campaign, a movement backed by Labour MPs, trade unions, students and church groups. The secret service reports, declassified earlier this year, can now be seen at the National Archives in Kew. Journalists were another Foreign Office target. Complaining of "black propaganda against the Chilean armed services", British officials tried to manipulate the news. When a team from the BBC Panorama programme visited Chile in November 1973, staff at the British embassy secured them "maximum co-operation from the junta".

The embassy was optimistic about the slant of the documentary, which included interviews with members of the Anglo-Chilean business community speaking approvingly about the coup. A British embassy official wrote: "The balance of the programme should be 60 to 75% favourable to the new regime." The embassy was not so pleased with a World in Action Granada TV team that arrived at the same time. The same official wrote: "I gathered that the WIA producer … came to cover torture and shootings … Granada's activities were certainly known to the junta whose press secretary told me that they had been seeing 'things they should not see'." An FCO official back in London scrawled on the letter: "Ominous news about the World in Action film".

But the archives also tell a more heartening story: an outpouring of concern and solidarity from the British public. In battered brown folders, sheaves of letters urge Edward Heath's government to take action against Pinochet – letters from an elderly couple in Leicester, "an appalled family" from London, from academics, students, Labour party branches and the "Bath Women's Liberation Front". There is even a telegram from a young Gordon Brown.

But most numerous are the letters from trade unionists. The shipbuilders' union urged the government not to sell warships to Pinochet, even though losing these contracts could threaten their own jobs. The government's response? To send spies to shipyards across Britain to check workers were not sabotaging vessels destined for Chile.

When Labour came to power in 1974, it cut off arms sales, aid and credit to Pinochet and, in 1977, withdrew the British ambassador. But existing arms contracts were to be honoured, so trade unionists took matters into their own hands. Employees at East Kilbride engineering yard in Scotland refused to fix bomber-plane engines destined for Chile, forcing Rolls Royce to break its contract with the Chilean air force. This forgotten history of solidarity will be celebrated across Britain today, the 40th anniversary of the coup.

Unsurprisingly, when Pinochet's most prominent defender, Margaret Thatcher came to office in 1979, diplomatic relations were soon restored and arms sales resumed. Declassified papers reveal that, by June 1982, her government had sold the dictatorship: two warships, 60 blowpipe missiles, 10 Hunter Hawker bomber planes, naval pyrotechnics, communications equipment, gun sights, machine guns and ammunition. A unique attempt at a British "ethical foreign policy" had ended.