Aimen Dean was arguably the most important spy inside al Qaeda for the UK's secret service agencies leading up to and following the September 11, 2001 terror attacks. After 9/11, al Qaeda plotted to release a poison gas inside New York City's subway system. In this edited excerpt from his book "Nine Lives," Dean reveals how the plot came to be and why it never happened:

(CNN) The device itself was not particularly impressive to look at.

Taped together from parts you might find in a tool shed, it had holes that would allow the 'violent spewing' out of cyanogen chloride, as a detailed description of the device later posted by American authorities said.

The detonator could be triggered by a timer or cell phone so that the attacker could deploy the weapon without sharing the choking, excruciating death it caused.

Return to 'The 2000s' Sundays at 9p ET/PT on CNN TV and CNNgo starting July 8.

On a gloomy afternoon in Afghanistan, before the events of September 11, 2001, al Qaeda jihadis and I rigged up a prototype and inserted a timed fuse to set off the detonator. The fuse set off the weapon as planned, and from a safe distance we heard a crack and a rush of air.

I felt sick to my stomach. Whether I liked it or not, the 'unique invention' -- the al-mubtakkar-al farid, as it quickly became known -- was born.

A new class of terrorist weapon had been created.

Something called a 'mubtakkar'

After 9/11, MI6 was enthusiastic about my moving to the Gulf. Bahrain was regarded as an important conduit between Saudi Arabia and Iran, where some in al Qaeda's upper echelons had taken refuge.

I did not advertise my presence there, but waited for opportunity to come my way. Within just a few weeks, it did. And it was no accident.

His name was Akhil, and he was a chemistry teacher.

A Saudi in his mid-30s, Akhil was working in Bahrain. He was balding and slightly overweight, with a forgettable face but intense, excitable eyes. He had fought in Afghanistan in the early 1990s.

JUST WATCHED Jihadist turned spy: ISIS unleashes "inner psychopath" Replay More Videos ... MUST WATCH Jihadist turned spy: ISIS unleashes "inner psychopath" 08:51

"You must have dinner with me. I know a great place on Exhibition Road," he told me.

Days later we were sharing grilled lamb and Bukhari rice. But I sensed this was not just a social event; Akhil had something to ask me. As the plates were cleared away he leaned forward, his eyes searching me.

"Are you by any chance also known as Abu Abbas al-Bahraini?" he asked quietly.

"Yes," I answered, "that was the name I took in Afghanistan." I had to tread carefully. I hardly knew this man.

"So you are aware of something called a mubtakkar?"

He now had my full attention.

"Yes, I am," I responded, and as casually as I could gave him the barest details about the device.

"I have an urgent message from your friends in Saudi Arabia who are looking for you. We have your notes from the mubtakkar. But we can't understand your handwriting."

Akhil slid a stack of papers with diagrams and formulae across the table. "Have we got it right?" he asked.

They had. Akhil knew his chemistry, and I could not lie to him for that very reason.

'Which is more deadly?'

A week later we met again at the same restaurant.

"I have great news," he went on, his eyes glowing. "Our brothers built the mubtakkar in the desert. There was a successful test."

How he loved being the go-between, at the center of the web.

"When you guys were developing the device, did you ever talk about the sarin attack in Tokyo?" he asked.

"Yes."

JUST WATCHED Cult leader executed for Tokyo sarin attack Replay More Videos ... MUST WATCH Cult leader executed for Tokyo sarin attack 00:31

His eyes flitted conspiratorially. For a moment he looked like a squirrel.

"Remember I asked you to confirm that cyanogen chloride was 2.47 times heavier than air?" Now he was into his chemistry teacher mode. "How will that affect how quickly it spreads in the ventilation of a subway system? Should we use it or hydrogen cyanide?" he asked. "Which is more deadly?"

He had used the English word "subway." He hadn't said metro or underground.

For a moment I forgot my training. "Subway, as in New York?"

He smiled but said nothing.

I had to cooperate, to sound as if I, too, wanted to maximize casualties. The best approach, I quickly decided, was to provide him a mix of information and disinformation. It was perturbing to be discussing the relative merits of gassing New Yorkers with what was in effect Zyklon B or the equally nasty cyanogen chloride.

"What can happen with both gases," I continued, "is that the lungs are flooded with fluid. Your last moments can include cardiac arrest, choking and violent seizures. It's a ghastly way to die."

The rapt attention on Akhil's face is an image I still remember. It was time to request an urgent meeting with British intelligence.

Al Qaeda's surprise

There followed more dinner meetings with Akhil, as I needed to find out more about their plans.

"We have four Saudi brothers already in Morocco and someone there who will teach them how to build the mubtakkar," he said. "They all have 10-year visas for the United States and can go anytime."

The operation had clearly moved beyond the planning stage. The enormity of what I was hearing was slowly sinking in.

JUST WATCHED What you should know about sarin gas Replay More Videos ... MUST WATCH What you should know about sarin gas 01:31

MI6 shared my intelligence with the Americans. My information was fed quickly up the chain to the White House. President George W. Bush was briefed in the Oval Office; according to one account there was stunned silence when the implications of the mubtakkar were absorbed.

Despite the fact that the invasion of Iraq was weeks away, the plot was discussed at length, with CIA Director George Tenet stressing the need to "chase down" the threat. The mood among some officials was later described as "just shy of panic." Might the cell already have been dispatched to the United States? Was there a plan to attack the New York subway the moment the invasion began? When the NYPD police chief Ray Kelly was eventually briefed he worried "the damage could be catastrophic."

But al Qaeda had another surprise in store.

JUST WATCHED How bin Laden became the face of terror Replay More Videos ... MUST WATCH How bin Laden became the face of terror 01:00

Al Qaeda's deputy leader, Ayman al-Zawahiri, had consulted al Qaeda's Shura Council. He was concerned that an attack in New York would be used to claim that Saddam Hussein had given al Qaeda weapons of mass destruction so that the Americans could legitimize the invasion of Iraq, however ridiculous the link.

"It's not going to happen," Akhil told me when we next met. "Zawahiri has cancelled the operation."

I tried to appear desperately disappointed despite the relief coursing through my veins. "So what are Zawahiri's instructions?" I asked.

"To keep knowledge about the mubtakkar under tight control," Akhil replied.

When my intelligence reached the White House, Vice President Dick Cheney was perplexed and worried that something bigger was in the works. For British intelligence, the priority was to prevent the mubtakkar blueprint from finding a wider audience.

On February 13, 2003, as a result of intelligence I provided to the British, Bahraini police stopped a group of men as they drove across the King Fahd Causeway. One of those detained was Bassam Bokhowa, an IT technician in his mid-30s. On his laptop they found blueprints for the mubtakkar.

Within hours of Bokhowa's arrest, MI6 and the CIA were poring over the blueprints. Any remaining skepticism that a real plot had been in the works was banished. The CIA arranged for a prototype of the device to be built and estimated that a coordinated attack involving multiple mubtakkars would undoubtedly be lethal. The agency was so disturbed by the outcome that they took the device to the Oval Office.

President Bush is said to have picked it up, saying quietly: "Thing's a nightmare."