Zazi, escorted once again by Ahmad, later received specialized explosives training in South Waziristan, where he learned to build and successfully tested a variety of explosive devices. (Medunjanin had flown home because his visa was about to expire, and Ahmedzay had gone to visit his wife in Afghanistan.) He was told how to find the necessary chemicals and told how to pack ball bearings into the device.

Soon after Obama won the U.S. presidential election in 2008, Shukrijumah came to the camp and told Zazi he wanted his group to send a message to shake the incoming president by launching an attack during the transition before he took office. Zazi told him he'd need more time. But he signaled his commitment to the plot by recording a martyrdom video that Shukrijumah scripted, which could be used by al Qaeda after the attack. Before returning to the United States he and Ahmad set up a way to communicate by coded e-mails.

Preparing an attack

Zazi returned to New York in January 2009 but soon moved to the Denver area to try to allay any suspicions counterterrorism agencies might have.

In spring 2009, he returned to New York and met with Ahmedzay and Medunjanin in Queens. As they shot hoops on a basketball court, Zazi asked, "Are we still into the plan?" According to Zazi's account, they said they were. But Ahmedzay didn't tell Zazi that his wife had threatened to set fire to herself if he was involved.

They settled on a plan to launch an attack during Ramadan (Islam's holiest month, which that year was from late August to late September). Their hope at this stage was to explode a huge car bomb outside a New York building. Ahmedzay was taking advantage of his work as a cab driver to scope out targets.

Zazi returned to Denver and began to purchase chemicals necessary for the attacks, from hair salons and hardware stores. Several months later, the FBI was able to retrieve security camera footage of his shopping spree. He had agreed with Ahmedzay that the two of them would do most of the preparations for the attack and would bring Medunjanin as a suicide bomber.

In August, Zazi returned to New York and met up with Ahmedzay, telling him he did not think he could make a large car bomb because of missing pages in the notes he had transcribed but could build smaller suicide vests. During a discussion later in this trip in the seclusion of Bear Mountain State Park in upstate New York, they agreed that Zazi would make the detonators in Denver. They also settled on a plan to target New York subways during morning or afternoon rush hour so they could inflict the heaviest number of casualties, instill fear and inflict maximum economic damage.

On August 28, Zazi reserved a room at HomeStead Studio Suites in Aurora, Colorado, and worked over the next three days on building a detonator in its kitchen. Eventually, he was able to make a quantity of the high explosive TATP, which he placed in a white glass jar. He took it to an open area for a test.

"It worked the way I had been shown," Zazi testified. It was a significant breakthrough, as detonators are the trickiest parts of explosive devices to make.

He called Ahmedzay in New York. "I fixed the wires in the computer," he said in code he presumed his friend would understand. But in making the main charge, he hit a snag. He wanted to make a bomb based on a mixture of flour and ghee oil but had failed to make an accurate note of the correct mixture. At the end of August, he contacted a relation in Peshawar -- and asked Ahmad to e-mail him.

On the afternoon of September 6, several hours after Ahmad got in touch by email, Zazi again checked into the same Denver hotel room to make an additional amount of detonating explosive so there would be plenty to make three bombs. By then, Zazi had decided to make the main of the charge in New York. He also brought up Christmas light bulbs, which he intended to modify to trigger the device, an electric measuring scale, a calculator and a quantity of hydrochloric acid for making any additional TATP.

Aborting the mission

Zazi knew something was wrong when he was stopped on the George Washington Bridge. He drove to Ahmedzay's home, gave him the detonating explosive to store there and told him to get in the car. But Zazi later testified that they were sure they were being followed. At trial, it emerged that agents assigned to New York's Joint Terrorism Task Force were on their tail.

The pair flushed the acid down a toilet in a nearby Islamic center and threw away the light bulbs. When he got home, Ahmedzay flushed the TATP detonating explosive down his toilet.

"There was some residue," Ahmedzay later said. "I light (it) with a match, and it kind of ignited and popped."

Later that evening, Zazi met Medunjanin at their Queens mosque. He took out his cell phone and wrote a text, without sending it, which he showed Medunjanin on the screen.

"Police is after me. We are done," the text read.

"I love you for the sake of God," Medunjanin replied, according to Zazi.

Zazi was arrested shortly after flying back to Denver. In his first interview with the FBI, which was videotaped and played in court, he claimed that the electronic scales found by police in New York were to help his sister bake cakes.

For months, the FBI held off arresting Zazi's two New York friends as they tried to build a case against them.

Ahmedzay was arrested in January 2010. Medunjanin was arrested the same month after crashing his car into another vehicle in what prosecutors stated was a failed suicide attack. According to court documents, moments previously, he had called 911 and exclaimed, "We love death more than you love your life."

The fixer Ahmad was picked up by Pakistani security services, according to U.S. intelligence sources, and is now in custody. He had also acted as the point person in a plot by a Norwegian al Qaeda terrorist cell. A senior U.S. counterterrorism official said his poor operational tradecraft in using the same e-mail address to communicate with different plotters provided U.S. authorities with a lucky break. At trial Zazi testified his cell was planning to carry out the attack just days after he drove up to New York City.

Shukrijumah was promoted up the al Qaeda hierarchy after Rauf was killed in a drone strike in Waziristan in November 2008.