Britain helped to capture one of the leading opponents of the Gaddafi regime before he was sent back to be tortured in Libya, according to a secret document discovered by The Independent on Sunday in the offices of Moussa Koussa, then Muammar Gaddafi's spymaster.

London's involvement in the rendition of Abdel-Hakim Belhaj, currently the military commander of rebel forces in Tripoli, is revealed in the letter from an MI6 officer. In it, he reminds Mr Koussa that it was British intelligence which led to the capture of Mr Belhaj, then leader of the Libyan Islamic Fighting Group, before he was sent to Libya in the rendition process by the Americans.

The senior UK intelligence official, whose identity is not being revealed by The Independent on Sunday for security reasons, then sought information obtained from the Islamist leader by "enhanced interrogation technique". Mr Belhaj had revealed that he was tortured during questioning.

The letter refers to Mr Belhaj by his nom de guerre, Abu 'Abd Allah Sadiq, and reads in part: "The intelligence about Abu 'Abd Allah was British. I know I did not pay for the air cargo [Mr Belhaj]. But I feel I have the right to deal with you direct on this and am very grateful to you for the help you are giving us."

The senior UK intelligence official wrote: "This was the least we could do for you and for Libya to demonstrate the remarkable relationship we have built over recent years... I was grateful to you for helping the officer we sent out last week. Abu 'Abd Allah's information on the situation in this country is of urgent importance to us."

So close had the relationship become that several Western European intelligence agencies were using the services of MI6 to approach the Libyans for help with their own terrorist suspects. The Swedish, Italian and Dutch services sought the help of the UK agency in liaising with Tripoli. A sign of the warmth of the relationship between British intelligence and their Libyan counterparts is shown in the stream of letters from London to Tripoli, headed "Greetings from MI6" and "Greetings from SIS".

Although the documents, which we have not been able to independently verify, relate to the years when Tony Blair's government was in power, they threaten to undermine the UK's relations with the new Libyan administration, the Transitional National Council (TNC). Last night one Conservative MP accused Blair's government of "aiding and abetting" the Gaddafi regime.

Most of the papers were found at the private offices of Moussa Koussa, the foreign minister, regime security chief and one of Gaddafi's chief lieutenants, on Friday afternoon. Rebel fighters had been inside the building and paperwork was strewn on desks and the floor amid broken glass. The building was locked up on the orders of the TNC yesterday morning.

Mr Koussa, who defected after the February revolution and spent time in the UK, left to take up residence in the Gulf after demands that he face police questioning over the murder of Libyan opposition figures in exile, the Lockerbie bombing and the killing of the policewoman Yvonne Fletcher. In a sign of the importance of the British connection, MI6 merited two files in Mr Koussa's office, while the CIA had only one. UK intelligence agencies had played a leading role in bringing Gaddafi's regime in from the cold.

The documents reveal that British security agencies provided details about exiled opposition figures to the Libyans, including phone numbers. Among those targeted were Ismail Kamoka, freed by British judges in 2004 because he was not regarded as a threat to the UK's national security. MI6 even drafted a speech for Gaddafi when he was seeking rapprochement with the outside world with a covering note stressing that UK and Libyan officials must use "the same script".

The Libyan government sought the services of British intelligence in attempting to block asylum applications by opponents of the regime. One document, regarding an application for refuge by a man with the initials SRA-Z (name withheld by The IoS for security reasons), led to a response from British officials. "It is not the practice of the UK government to comment on possible asylum cases."

However, the intelligence agency then sought to gain information about the applicant. The letter, addressed to "Dear Friends", said: "We are sorry we can't be more helpful in this case but we must comply with this practice. We... would welcome hearing from your service why you are interested in Mr A-Z so we could consider what action we might wish to take should we become aware of him."

Other documents show urgent requests for information about Abu Hamza al-Libi, said to be a senior al-Qa'ida operative who had travelled to the UK from Italy and the Netherlands to collect forged UK passports destined for Iran. Al-Libi was suspected of being involved in a plot to carry out a cyanide attack in Rome in 2002. He was detained in Britain, but freed in January 2010. He is believed to have died in a motorbike crash in London eight months later.

Ben Wallace, a Conservative MP, said the last government should be made to answer publicly for "conspiring" with Gaddafi's regime. The former military intelligence officer said: "Giving countries like this information they can use to oppress their people and break international law amounts to aiding and abetting the Gaddafi regime. We need to get to the bottom of how far British officials and ministers went to assist the Libyans to do their job of suppressing their own people. We might hand information like this over to our allies, but we would be confident they would use it lawfully. You can't have that confidence with Gaddafi."

Britain's extraordinary rekindling of relations with Libya did not start as Mr Blair sipped tea in a Bedouin tent with Gaddafi, nor within the walls of the Travellers Club in Pall Mall – although this "summit of spies" in 2003 played a major role. It can be traced back to a 1999 meeting Mr Blair held with the man hailed as one of the greatest to have ever lived: Nelson Mandela, in South Africa.

Mr Mandela had long played a key role in negotiations between Gaddafi, whom he had hailed as a key opponent of apartheid, and the British government. Mr Mandela first lobbied Mr Blair over Libya in October 1997, at a Commonwealth heads of government meeting in Edinburgh. Mr Mandela was pressing for those accused of the 1988 Lockerbie bombing to be tried outside Scotland. In January 1999, Mr Mandela, during a visit by Mr Blair to South Africa, actively lobbied the PM on behalf of Gaddafi, over sanctions imposed on Libya and the Lockerbie suspects.

UN sanctions were suspended in April 1999 when Gaddafi handed over the two Lockerbie suspects, including Abdelbaset al-Megrahi, who was eventually convicted of the bombing. Libya also accepted "general responsibility" for the death of Yvonne Fletcher. Both moves allowed the Blair government to begin the long process of renewing ties with Libya.

Within a couple of years, the issue of persuading the Gaddafi regime to turn itself from pariah into international player surged to the forefront of the British government's agenda. It was during this time, according to the documents found in Mr Koussa's office, that MI6 and the CIA began actively engaging with Libyan intelligence chiefs. But it was a key meeting on 16 December 2003, at the Travellers Club, that would put the official UK – and US – stamp on Gaddafi's credibility. Present were Mr Koussa, then head of external intelligence for Libya, and two Libyan intelligence figures; Mr Blair's foreign affairs envoy, Sir Nigel Sheinwald, and three MI6 chiefs; and two CIA directors. Mr Koussa's attendance at the meeting in central London was extraordinary – at the time he had been banned from entering Britain after allegedly plotting to assassinate Libyan dissidents, and so was given safe passage by MI6.

Mr Koussa's pivotal role at the Travellers Club casts light on how, following his defection from Gaddafi's regime during the initial Nato bombing campaign earlier this year, he was able to slip quietly out of the country. Two days after the 2003 meeting, Mr Blair and Gaddafi held talks by telephone; and the next day, 19 December, the announcement about Libya surrendering its WMD was made by Mr Blair and President Bush.

In March 2004, Mr Blair first shook hands with Gaddafi in his Bedouin tent. The pair then met again in May 2007, shortly before Mr Blair left office.

Downing Street and the doctorate

Tony Blair helped Muammar Gaddafi's son and heir, Saif al-Islam, with his controversial PhD thesis while at the London School of Economics, new documents unearthed in Tripoli revealed last night.

The former premier sent Saif a personally signed letter on Downing Street headed paper – addressed in his own handwriting to "Engineer Saif" – which thanked Saif for showing him "your interesting PhD thesis". The letter was written on 5 March 2007, two months before Mr Blair's second meeting in the Libyan desert with Colonel Gaddafi.

Mr Blair helped Saif on a number of points, including offering examples of co-operation between governments, people and business "that might help with your studies". Saif Gaddafi later gained a PhD from the LSE in 2008. It was claimed that Saif, who donated £1.5m to the institution, plagiarised large parts of his work.

Yet a spokesman for Mr Blair last night denied that the ex-PM had seen the thesis "in full or in draft form" and said that officials had drafted the letter.

The spokesman added: "Tony Blair didn't see Saif Gaddafi's thesis in full or in draft form. What he did receive was a letter from officials for him to sign, which was entirely appropriate.

"Saif Gaddafi wrote to Downing Street. He did not send in his thesis. Officials drafted a reply that the Prime Minister signed. That was the entirely appropriate way to handle the correspondence."

Saif Gaddafi, who also has links to Mr Blair's ally Peter Mandelson, was seen as his father's successor before the regime fell. Just days before the rebels seized Tripoli, he turned up in the middle of the night in front of TV cameras claiming his father's forces had overcome the advance.

Jane Merrick

Timeline: From Lockerbie to Martyrs' Square

21 December 1988 Pan Am Flight 103 explodes over Lockerbie, killing 270 people

November 1991 US and UK accuse Abdelbaset Ali al-Megrahi and Lamin Khalifah Fhimah of being responsible.

April 1999 UN sanctions on Libya suspended after suspects handed over

31 January 2001 Megrahi found guilty and jailed for life, Fhimah cleared. Foreign Secretary insists "no deal" with Libya on Megrahi's sentence and "full sentence will be served in a Scottish prison"

2002 CIA and MI6 begin active engagement with Libyan intelligence agents

15 August 2003 Libya officially accepts responsibility for Lockerbie and agrees to compensate relatives of the victims

16 December 2003 Senior Foreign Office, MI6, CIA and Libyan officials agree deal to bring Libyain from cold at the Travellers Club in Pall Mall

24 March 2004 Blair offers Gaddafi "hand of friendship" during talks in a tent outside Tripoli

May 2007 Blair meets Gaddafi again for talks in Libyan desert

21 October 2008 Megrahi has advanced-stage prostate cancer

25 July 2009 Megrahi asks to be released from jail on compassionate grounds

20 August 2009 Scottish government releases Megrahi

15 February 2011 Arrest of human rights campaigner in Benghazi sparks wave of protests

27 February 2011 Blair calls Gaddafi twice to ask him to stop the slaughter of protesters

17 March 2011 UN no-fly zone authorised over Libya. Two days later Britain and France begin bombing military targets