US authorities describe the main Pakistani intelligence service as a terrorist organisation in secret files obtained by the Guardian.

Recommendations to interrogators at Guantánamo Bay rank the Inter-Services Intelligence Directorate (ISI) alongside al-Qaida, Hamas and Hezbollah in Lebanon as threats. Being linked to any of these groups is an indication of terrorist or insurgent activity, the documents say.

"Through associations with these … organisations, a detainee may have provided support to al-Qaida or the Taliban, or engaged in hostilities against US or coalition forces [in Afghanistan]," says the document, dated September 2007 and called the Joint Task Force Guantánamo Matrix of Threat Indicators for Enemy Combatants. It adds that links to these groups is evidence that an individual poses a future threat.

The revelation that the ISI is considered as much of a threat as al-Qaida and the Taliban will cause fury in Pakistan. It will further damage the already poor relationship between US intelligence services and their Pakistani counterparts, supposedly key allies in the hunt for Osama bin Laden and other Islamist militants in south Asia.

Relations between America and Pakistan have been tense for years. A series of high-level attempts have been made in recent weeks to improve ties after the American CIA contractor Raymond Davis killed two Pakistanis in January.

In November the Guardian published evidence that US intelligence services had been receiving reports of ISI support for the Taliban in Afghanistan for many years. The reports were frequent and detailed, if unconfirmed and sometimes speculative.

The Threat Indicator Matrix is used to decide who among the hundreds of Guantánamo detainees can be released. The ISI is listed among 36 groups including Egyptian Islamic Jihad, led by al-Qaida deputy leader Ayman al-Zawahiri; the Sabotage Battalion of Chechen Martyrs; the Iranian intelligence services; and the Muslim Brotherhood.

Though the document dates from 2007 it is unlikely the ISI has been removed from the current Threat Indicator Matrix.

In classified memos outlining the background of 700 prisoners at Guantánamo there are scores of references, apparently based on intelligence reporting, to the ISI supporting, co-ordinating and protecting insurgents fighting coalition forces in Afghanistan, or even assisting al-Qaida. Pakistani authorities have consistently denied any links with insurgents in Afghanistan or al-Qaida.

The documents detail extensive collaboration between the ISI and US intelligence services. Many of those transferred to Guantánamo Bay, including senior al-Qaida figures such as Khaled Sheikh Mohammed, who planned the 9/11 attacks, and Abu Farraj al-Libbi, one of the group's most capable operators, were arrested with Pakistani help or turned over to American authorities by Pakistani intelligence services.

The memos rely on a variety of sources to make their case. Though the broad argument for releasing or detaining an individual has sometimes been made public during military tribunals at Guantánamo, the material underpinning those arguments has remained secret until now. Sources for that material include the interrogation of the detainee whose release is being discussed, as well as the records of the questioning of hundreds of other prisoners.

Intelligence from elsewhere, including foreign spy agencies such as the Afghan National Directorate of Security, appears to have been extensively used. There is little independent corroboration for the reporting and some of the information is likely to have been obtained under duress. Systematic human rights abuses have been recorded at Guantánamo.

The details of the alleged ISI support for insurgents at the very least give an important insight into the thinking of American strategists and senior decision-makers who would have been made aware of the intelligence as it was gathered. Many documents refer to alleged ISI activities in 2002 or 2003, long before the policy shift in 2007 that saw the Bush administration become much more critical of the Pakistani security establishment and distance itself from Pervez Musharraf, who was president.

One example is found among reasons given by Guantánamo officials for the continued detention of Harun Shirzad al-Afghani, a veteran militant who arrived there in June 2007. His file states he is believed to have attended a meeting in August 2006 at which Pakistani military and intelligence officials joined senior figures in the Taliban, al-Qaida, the Lashkar-e-Taiba group responsible for the 2008 attack in Mumbai and the Hezb-e-Islami group led by Gulbuddin Hekmatyar.

The meeting was to discuss operations in Afghanistan against coalition forces, says the memo. It cites an unidentified letter in the possession of US intelligence services describing the meeting which, it says, ended with a decision by the various insurgent factions "to increase terrorist operations in the Kapisa, Kunar, Laghman and Nangarhar provinces [of Afghanistan], including suicide bombings, mines, and assassinations".

Harun Shirzad al-Afghani was reported to have told his interrogators that in 2006 an unidentified Pakistani ISI officer paid 1m Pakistani rupees to a militant to transport ammunition to a depot within Afghanistan jointly run by al-Qaida, the Taliban and Hekmatyar's faction.

According to Afghani, who was captured in the eastern Nangarhar province, the depot contained "about 800 rockets, AK-47 and machine gun ammunition, mortars, RPGs [rocket propelled grenades] and mines" and had been established "in preparation for a spring 2007 offensive".

More than 230 western troops were killed in Afghanistan in the course of 2007; 99 between January and June.

A separate document about a 42-year-old Afghan detainee cites intelligence reports claiming that in early 2005 Pakistani officials were present at a meeting chaired by Mullah Mohammed Omar, the supreme chief of the Taliban, of an array of senior insurgents in Quetta, the Pakistani city where it has long been believed the Taliban leadership are based.

"The meeting included high-level Taliban leaders … [and] representatives from the Pakistani government and the Inter-Services Intelligence Directorate," the document says. It adds: "Mullah Omar told the attendees that they should not co-operate with the new infidel government (in Afghanistan) and should keep attacking coalition forces."

Many references are more historic. A memo about another detainee, Abdul Kakal Hafiz, cites intelligence that in January 2003, insurgents in the Zabul province of Afghanistan received a month of training in explosives, bomb-making and assassination techniques from "three Pakistani military officers". The training was apparently "conducted in preparation for a planned spring campaign to assassinate westerners". A Red Cross water engineer, Ricardo Mungia, was shot and killed by insurgents on 27 March 2003 in Oruzgan province. The murder had a major effect on humanitarian and development programmes in south and eastern Afghanistan and was a huge setback for western-led efforts.

According to the files on an Afghan known simply as Hamidullah, captured by Afghan national army soldiers in July 2003, intelligence "reporting" from December 2002 "linked detainee to a Pakistani ISI initiative to create an office in [the Pakistani frontier city of] Peshawar combining elements of the Taliban, HIG [Hekmatyar's group] and al-Qaida".

The memo said that intelligence indicated "the goal of the initiative was to plan and execute various terrorist attacks in Afghanistan" including one on the HQ of foreign entities in Kabul in January 2003.

Another file on a high-profile Afghan religious and political leader detained months after the initial invasion of Afghanistan and released in 2008 refers to ISI operations in the eastern province of Kunar during 2002 that were, the memo says, designed to destabilise the new Afghan government under Hamid Karzai, who had been installed as interim president by the US-led coalition.

"In January 2002 ISI financed the activities of several factions … in Kunar … in order to destabilise the Afghan [government]. In March 2002 [the ISI] reportedly provided $12,000 … to finance military operations against the new government," the document says.

The file reveals that the detainee, Mullah Haji Rohullah, was working with the British government, and possibly MI6, when detained. "This detainee ... had dealings with the United Kingdom and with the Pakistani [ISI]," says the memo, dated 17 June 2005.

The documents show the varying interpretations by American officials of the apparent evidence of ISI involvement with insurgents in Afghanistan. There are repeated "analyst's notes" in parentheses. Several in earlier documents stress that it is "rogue elements" of the ISI who actively support insurgents in Afghanistan.

One describes how "rogue elements of the ISI are known to have had sympathies for and provided support to anti-coalition militia. The most significant was sniper training and the use of remote control improvised explosive devices." Another file from 2005 says that "rogue factions from the ISI have routinely pursued private interests and acted against the stated policy of the government of Pakistan".

The analysis that such operations were not sanctioned policy for the ISI was current among US and British intelligence officials as late as 2007. By 2008 the view of western services had changed and such caveats are rare in later documents.

The files reveal much of the shadow war in Afghanistan fought out by secret services – a contemporary form of the 19th century Great Game. There are a series of references to Iranian intelligence; these again are unconfirmed. One intelligence report cited in the file on an Afghan called Khair Ulla Said Wali Khairkhwa, who arrived at Guantánamo in May 2002, refers to "a meeting initiated by Iran, possibly by Iran's Islamic Revolutionary Guard Corps" between Iranian officials and Taliban representatives near the Afghan-Iranian border in October 2001. The officials allegedly offered to broker a coalition between the Northern Alliance, which was allied with the west, and the Taliban in their fight against US intervention. According to the memo, the Iranian delegation "offered to open the borders to Arabs who wanted to cross into Afghanistan to fight against US and coalition forces".

Around 18 months after the fall of the Taliban, another memo claims, Iranian intelligence gave a former Taliban commander and Hekmatyar US$2m to fund "anti-coalition militia" activities. Citing further intelligence reports, the file says: "In December 2005, representatives of Ismail Khan, former governor of Herat and minister of water and power in Afghanistan, met with two Pakistanis and three Iranians to discuss the planning of terrorist acts and to create better lines of communication between the [Hekmatyar group] and Taliban."

This latter claim appears highly speculative as Khan is a long-term enemy of Hekmatyar and the Taliban – in 2009 he narrowly survived a suicide attack for which insurgents claimed responsibility.