In February 2003, a small team of officials from the International Atomic Energy Agency (IAEA) made their way across the plains of central Iran to a place called Natanz. They were on their way to a site which the Iranians claimed was involved in studying agricultural desertification, but which an Iranian opposition group had recently said was the site of a secret Iranian nuclear programme.
When the inspectors were escorted into the halls of the buildings, they were stunned. In one hall was a cascade of centrifuge machines - the technology used to enrich uranium either for nuclear fuel or for weapons. Another large hall, empty at the time, had room for 50,000 such machines, according to the Iranians.
One of the inspectors on that visit, a Finn called Olli Heinonen, who had investigated Iran's nuclear programme for many years, couldn't believe what he was seeing. The sophistication of the facilities and the technology suggested that the Iranians' nuclear programme had moved far faster than anyone had ever suspected. "How have you done it?" he asked his escort from Iran's own atomic-energy agency. "With information off the internet", his escort replied.
Olli Heinonen knew that this was impossible.
Gordon Corera is BBC security correspondent and the author of Shopping for Bombs: Nuclear Proliferation, Global Insecurity and the Rise and Fall of the AQ Khan Network
(C Hurst, 2006 and Oxford University Press, 2006)
Also in openDemocracy on AQ Khan and nuclear proliferation:
Pervez Hoodbhoy, "Pakistan: inside the nuclear closet"
(3 March 2004)
Patricia Lewis, "The NPT review conference: no bargains in the UN basement"
(1 June 2005)
When a British inspector later saw the centrifuges for himself, he immediately knew how the Iranians had made their great leap forward. Every single detail of the centrifuges - down to the millimetre, down to the exact tolerances of the different parts - was identical to models he remembered from his work in the early 1970s for an organisation called Urenco, based in the Dutch town of Almelo. Urenco was a European consortium which enriched uranium for nuclear fuel; the British inspector recalled that another scientist working there at the same time was a young Pakistani scientist called Abdul Qadeer Khan.
The Natanz connection was just one of a number of events which led to the downfall of AQ Khan. The most important would come in December 2003, when Libya's Colonel Muammar Gaddafi surprised everyone by giving up something most people didn't even know he had: an active nuclear-weapons programme. The finger again pointed directly at AQ Khan as being responsible for providing that capability.
It is possible tell a large part of the story of the spread of nuclear weapons over the past thirty years through the story of AQ Khan: Pakistan's own programme, North Korea, Iran, Libya, the emergence of a black market in nuclear technology. In all of these areas you can find AQ Khan either centre-stage or lurking in the shadows. Khan has wreaked havoc on attempts to restrain the spread of nuclear technology. He has lowered the barriers of entry for the nuclear game. He has irreversibly changed the mechanics of supply and demand, and left a truly damaging legacy.
The Khan nexus
Abdul Qadeer Khan was not a spy when he came to Europe: he became one while living there. He got a job at Urenco just as his Pakistani homeland was going through a major crisis following its defeat in a war with India (over the secession of Bangladesh, formerly East Pakistan) in 1971. Pakistan felt that its very survival was at stake, and that it had no allies it could depend on. As a result, the idea began to grow in Pakistan's national-security circles that the nuclear bomb was its only potential means of survival, particularly because it feared India might be developing its own weapons.
Khan was deeply affected by Pakistan's defeat in 1971 and he realised that through his job at Urenco, he had access to something incredibly valuable - the most secret advanced designs that Europe had on centrifuge technology. After stealing the designs, Khan returned to Pakistan to build a global procurement network supplying the parts for Pakistan's own bomb. His network was mainly based on European businessmen who were happy to reap profits.
By the time Pakistan was ready for its nuclear test in May 1998, Khan had been doing much more than building Pakistan's bomb. He had made the transition from procurer to salesman, shifting the network he had built up from import to export.
His first major deal took place in a hotel room in Dubai in 1987. Iranian officials paid around $3 million for a set of designs. Iran then tried to use the designs to buy the parts to build its own centrifuges, but it struggled. In 1993, Iran and the Khan network resumed contact and this time signed up for a larger deal of actual centrifuge machines and parts. The relationship with Iran continued on and off until about 1999. The material provided by Khan became the foundation for the centrifuge programme based in Natanz.
Khan also cut other deals - most importantly with North Korea and Libya. The Libya deal of the mid-1990s marked a step-change for the Khan web as it expanded in scope to meet Colonel Gaddafi's huge order. But Khan's growing ambition would also be the source of his downfall. The increasing extent of the network would be one of the factors which would alert the CIA and Britain's MI6 that Khan was much more dangerous than they had realised, leading them to target his business associates.
But even after United States and United Kingdom intelligence had penetrated the Khan operation, bringing it down was not easy. Khan had become a national hero in Pakistan because of his role in delivering the nuclear bomb and thus (in the eyes of millions) security to the country. Meanwhile, after 9/11 the US relationship with Pakistan was also transformed as Pervez Musharraf's regime became a key ally in the fight against al-Qaida.
During this period, there was a very vigorous debate between the US and the UK - involving both intelligence officials and diplomats on either side - about exactly when and how to stop Khan. Some people wanted to continue watching to find out more about Khan's customers, partly to make sure they really understood the reach of his web; others wanted it stopped quickly. But even once the decision was made to intervene, this could not be done easily: knowing something is happening is not the same as knowing how to stop it.
The breakthrough and the legacy
The lucky break came when, for his own reasons, Colonel Gaddafi decided to come clean about Libya's nuclear plans. This began a complicated set of negotiations which would eventually lead to the exposure of Khan and his network. Khan was eventually forced to confess on national television and put under house-arrest at his home in Islamabad.
In September 2006, he was allowed briefly to visit hospital for prostate-cancer treatment. But the CIA and other interested agencies have never been given the chance to question him directly. Instead they have to pass their questions through Pakistan's intelligence agency, the Inter Services Intelligence (ISI). The restriction matters greatly, because there are still many unanswered questions about Khan's story.
For instance, what exactly did he provide to Iran? It is clear that he supplied a nuclear-weapons design to Libya, so could he have also passed one to Iran? The Iranians assert that their programme is entirely peaceful, designed for civil nuclear research only. But the US and others wonder: if that is indeed the case, why have the Iranians been so reticent about their relationship with AQ Khan?
In late 2005, IAEA inspectors were once again in Iran and found some boxes of documents which the authorities refused them permission to take away. The inspectors reported that on sight, one of the documents looked similar to one the Libyans had handed over, whose contents related to instructions on manufacturing a nuclear warhead.
The Iranians say that the Khan network gave the document to them unasked. Some members of the Khan network have claimed that it supplied Iran with more advanced P2 centrifuges, something the Iranians also deny. These details matter because without really knowing what Iran received, all the estimates about how much progress Iran has made in its nuclear technology remain guesswork.
Meanwhile, Khan's legacy extends well beyond the crisis with Iran. Another unanswered question is whether the Khan network had even more customers than are currently known about. It is known that he at least had contact with many other countries and travelled widely. Towards the end of the network's life, the intelligence agencies eavesdropping on Khan picked up talk about a new deal among businessmen in his circle. Who else might have received the once-sensitive nuclear technology that Khan was trading in?
Abdul Qadeer Khan has done huge damage to attempts to prevent the spread of nuclear weapons. He has increased supply by putting more knowledge and technology in the marketplace. And he's increased demand by helping key states, like Iran, progress in their nuclear programmes. But what's most worrying about AQ Khan's story is that we still don't know for sure quite how much damage he has really done. Indeed, we may never find out.
Get our weekly email