David Cameron has ordered an urgent investigation into possible British involvement in a deadly raid on a temple in India.

Previously secret documents indicate an SAS officer helped the Indian authorities draw up plans to remove dissident Sikhs from the Golden Temple in Amritsar in 1984.

The Prime Minister has asked Cabinet Secretary Sir Jeremy Heywood to look into the case and report back to him, with the Government acknowledging the papers raise "legitimate concerns".

Hundreds died in the raid by the Indian army on the temple in June 1984, and in October that year the country's prime minister, Indira Gandhi, was assassinated by two Sikh bodyguards in an apparent act of revenge.

The papers, released under the 30-year rule and published on the Stop Deportations blog, indicate that then prime minister Margaret Thatcher was aware of the involvement of an SAS officer in drawing up a plan - although it is not clear whether the Indian army operation followed this advice.

The request for British advice is disclosed in a letter, dated February 23, 1984, from Brian Fall, private secretary to then foreign secretary Geoffrey Howe, to Hugh Taylor, his counterpart under home secretary Leon Brittan. The letter said: "The Indian authorities recently sought British advice over a plan to remove Sikh extremists from the Golden Temple in Amritsar. The Foreign Secretary decided to respond favourably to the Indian request and, with the Prime Minister's agreement, an SAD (sic) officer has visited India and drawn up a plan which has been approved by Mrs Gandhi. The Foreign Secretary believes that the Indian Government may put the plan into operation shortly."

In an indication of the sensitivity of the matter, the letter continued: "An operation by the Indian authorities at the Golden Temple could, in the first instance, exacerbate the communal violence in the Punjab."

Mr Cameron and Foreign Secretary William Hague were not aware of the British link until the files were published.