The spy was Juergen Gietler, 42, an official in the German Foreign Ministry in Bonn, who handed over to Iraq top secret papers giving details of the deployment of American and allied forces to the Middle East in the weeks after Saddam Hussein, the Iraqi leader, invaded Kuwait in 1990.
General Wafiq al-Sammara'i, the head of Iraqi military intelligence during the Gulf crisis, who defected three years ago, says that Mr Gietler first approached the Iraqi military attache in Bonn at a party in a hotel just after the Iraqi invasion. "In the next four weeks," he said, "he gave us vital information about allied military plans, particularly the deployment of a US armoured division and A-10 anti-tank planes to the Gulf."
The information enabled Iraqi intelligence officials to give Saddam a full picture of the allied military build-up around Kuwait. They also told him that they considered war inevitable.
Mr Gietler provided Iraq with a German intelligence report revealing what information was known to US and its allies about the location of Iraqi Scud B missile batteries, according to secret documents from his trial which was held in camera in 1991. The judgment of the court says that information provided by Mr Gietler enabled Iraq to disguise its missile batteries or replace them with decoys, so allied aircraft could not find them.
Gen Sammara'i's exclusive account of the brief career of Iraq's most successful spy - the first details of the affair to be revealed by an Iraqi official - contradicts some details of what was revealed at Mr Gietler's trial. The differences can be explained if the priority of the German prosecution and intelligence service was to keep secret the fact that the Iraqi codes had been broken.
The confidential court documents, obtained by German weekly Der Spiegel, say that among the papers handed over to the Iraqis by Mr Gietler was a message on 7 August - five days after the Iraqi attack on Kuwait - from President George Bush to Chancellor Helmut Kohl of Germany, detailing army, air force and navy units being sent to the Gulf. Mr Gietler, who had access to the Foreign Ministry's register for classified documents, had copied the key to the registry at a booth in Bonn railway station during his lunch break.
When he was arrested on 28 August as he left the ministry, he was carrying 51 documents in a plastic bag, 46 of which dealt with the Gulf crisis, the court was told. Some of these were of the highest importance. Nevertheless Mr Gietler received only a five-year sentence at his short trial in Dusseldorf and he was released in 1994. He is now a businessman in Africa.
Gen Sammara'i's story of what happened is more convincing than that given at the trial. He says that, contrary to the German account, Mr Gietler only worked for Iraq for a month, though the information he passed over was vital. He says the first contact was made by Mr Gietler, an archivist at the Foreign Ministry, when he met Staff Brig Gen Osmat Judi Mohammed, the newly arrived Iraqi military attache, at the party in Bonn. "He said he wanted to give us information," said Gen Sammara'i. "Osmat Judi told us what had happened in a coded message to Baghdad."
At first the Iraqis suspected a plant by German intelligence. What convinced them Mr Gietler's offer was genuine was when they believed they had discovered a discreditable motive for his betrayal. "He had just divorced his wife, and under German law this had cost him a lot of money in alimony. We told Osmat Judi to pay him what he wanted, and in four weeks he received at least $10,000."
Mr Gietler's account of his motive for treachery is different. He had converted to Islam when in Cairo in 1982, and says that during the 1980s he passed secret German documents about Israel and the Middle East to Egypt. This would explain something that had surprised Iraqi intelligence. "Osmat Judi noticed that at the first meeting Gietler did not seem frightened," said the former intelligence chief. "He wondered why." Mr Gietler's lack of fear would be understandable if this was not the first time he had acted as a spy for an Arab country.
Iraq invaded Kuwait on 2 August 1990. Documents were pouring into the German foreign ministry about the creation of the US-led allied coalition against Iraq. Mr Gietler was in touch with Gen Osmat Judi every two or three days. They met in hotels or shops. Gen Sammara'i, 50, an intelligence veteran whose career had flourished during the Iran-Iraq war, said that Brig Gen Osmat Judi, showed real professionalism, although his background was as a military engineer in Iraq's military headquarters: "After Saddam agreed to his appointment he had just two or three months training in military intelligence before he went to Bonn, but he did very well."
At his trial Mr Gietler was said to have also provided Iraq with secret French satellite photographs of Israeli missile deployments. Gen Sammara'i says he has no memory of receiving these. The story is a little strange, since Israel's Jericho 1 and 2 missiles, which can carry a nuclear warhead, were only deployed later. If the reference is to American-manned Patriot anti-missile batteries, they were only sent to Israel just before the outbreak of the Gulf war.
The official German explanation of how Mr Gietler was caught is that it followed routine German tapping of the phones at the Iraqi embassy in June. But it is unlikely that Iraqi intelligence officers, probably the most suspicious people in the world, would reveal information on the phone. It also does not explain why German security allowed Mr Gietler, if they knew he was a spy, to have access to all classified documents for the first critical month of the Kuwait crisis. Gen Sammara'i says: "I am quite convinced they had broken our codes."