Within three weeks of the Soviet invasion of Afghanistan the cabinet secretary, Sir Robert Armstrong, was negotiating how to channel covert military aid towards the "Islamic resistance" that was fighting the Russians.

Details of how swiftly clandestine weapons routes were opened up to aid the mujahideen emerge from secret cabinet documents released to the National Archives today under the 30-year rule.

The files show how extensive military and diplomatic efforts – co-ordinated with western allies – were made to defeat the USSR and the lengths to which Thatcher went to discourage participation in the 1980 Olympics.

Shortly after KGB special forces seized control of Kabul on 27 December 1979, the foreign secretary, Lord Carrington, expressed the view: "The Russians are resorting to the big lie by saying that they intervened at the invitation of Afghan authorities … we should take every opportunity to make them uncomfortable and bring home to them the consequences of their actions."

In mid-January Armstrong sent a "secret, personal" note to the prime minister on a meeting in Paris between senior US, French, German and British officials.

"There was some discussion of support for Afghan resistance to the invading Soviet troops," he explained. "For obvious reasons, I am circulating it separately from the record for the rest of the discussion."

Zbigniew Brzezinski, the US national security adviser, recommended providing Afghan fighters in "forward positions" just inside the Pakistan border with "surface to air missiles to defend themselves against air attack".

The French proposed channelling military aid via the Iraqis. The aim of the west, they said, should be to keep the Islamic world "aroused about the Soviet invasion that would be served by encouraging a continuing guerrilla resistance".

Armstrong stressed that a border war should be avoided but "so long as the Afghans were ready to continue guerrilla war resistance and Pakistan was prepared … to acquiesce in [its] territory being a base for such activity, the west could hardly refuse to provide support where it could do so with suitable discretion".

The cabinet secretary also sent a note to Thatcher, Carrington and "C" (the head of MI6) arguing the case for military aid to "encourage and support resistance".

Armstrong said intervention "would make more difficult the process of Soviet pacification of Afghanistan and [ensure] that process takes much longer than it would otherwise do; and the existence of a guerrilla movement in Afghanistan would be a focus of Islamic resistance which we should be wanting to continue to stimulate".

There were further "secret four powers talks" in London. On 1 February Carrington informed Thatcher that one of the main ideas being pursued was "support for patriots inside Afghanistan through the covert supply of arms and training. French officials favour this. The Chinese are also interested; and the US are active in this respect. Muslim money is already flowing and may be sufficient."

The West German chancellor, Helmut Schmidt, described the US position as "thoroughly dangerous" and a "clear and present danger of a third world war".

Nor were US/UK intelligence relations always harmonious. A cabinet joint intelligence committee (JIC) minute records: "FCO interested to know whether there was any evidence to corroborate the assertion in a CIA situation report, dated March 4th, that there 'were some signs that the Soviets may be laying the groundwork for military – or other operations – against Pakistan'."

The JIC's assessment staff were dismissive, observing that there was no corroborative evidence and "indeed the intelligence available to the CIA did not justify such an assertion".

The west's arming of the mujahideen in Afghanistan has been seen as one of the contributing factors in the rise of al-Qaida. Osama bin Laden was a prominent Saudi financier of the mujahideen.

Other anti-Soviet avenues were also explored. The government considered stepping up broadcasts from the free world to the Soviet Union and the Muslim world. Carrington suggested preventing the Duke of Edinburgh from flying to Moscow for the Olympic Games that summer.

On 20 January the US president, Jimmy Carter, sent the prime minister advance notice of his intention to announce a US boycott of the Games and sought her support. The idea had already been discussed in cabinet.

Carter's letter, addressed to the US Olympic committee, stated: "I cannot support United States participation in the summer Olympic Games in Moscow, the capital city of a nation whose invading military forces are occupying Afghanistan."

As the boycott gathered pace, Thatcher fired off a series of letters to leading figures in the sports world pressing them to stay away from Moscow. The games nonetheless went ahead.

Alan Brooke Turner, a senior diplomat at the Moscow embassy, sent a cable in July describing the impact. "Despite the fact that numbers have had to be made up in some sports (with teams such as the Tanzanian hockey team) or individuals (like Vietnamese swimmers with no previous sporting record)," he remarked, "there have been enough contests of excitement and note to demonstrate that the Soviet authorities can organise a major sports occasion like the Olympics and organise it well."