The 2007 raid at Islamabad's Lal Masjid, where Faisal Shahzad often prayed when visiting his home, was the "triggering event" that drove the Pakistani-American to terrorism, culminating into the failed Times Square bombing plot.
The Red Mosque, believed to have become a hub of extremist activity, was stormed by the forces of former President Pervez Musharraf in 2007 after days of siege. Nearly a 100 people died in the raid.
Lal Masjid was the mosque, where Shahzad had offered prayers on his frequent trips to Pakistan.
"That was the triggering event," a person familiar with the case told the New York Times, which pieced together bits of Shahzad's journey on the terror path from interviews with people who are currently involved in his interrogation.
Musharraf had defended the raid, saying it was prompted by intransigent militants who had "challenged the writ of the government".
He said the mosque was being misused by extremist elements.
Three years after the Red Mosque raid, 30-year-old Shahzad, son of a retired Air Vice Marshal, drove an explosive-laden Nissan Pathfinder to Times Square on May 1.
This week, Shahzad pleaded guilty to 10 terror and weapons charges.
During the court hearing, he described himself as a "Muslim soldier" and warned that the US would face more attacks if they continued operations in "Muslim lands".
"One has to understand where I'm coming from... I consider myself... a Muslim soldier," he said, expressing anguish at the continued presence of US in Muslim countries like Afghanistan and Pakistan as well as the drone attacks on the Af-Pak border.
Shahzad, who will be sentenced on October 5, was apprehended at John F Kennedy airport trying to escape to Dubai and has been cooperating with the federal authorities by providing them with information.
The father of two children worked as a financial analyst in Connecticut where he lived with his wife.
The NYT reported that Shahzad came into contact with militants in Pakistan through a network of friends starting with Shahid Hussain, a 32-year-old Pakistani whom Shahzad met in business school in Connecticut.
In Islamabad, the two friends and a third man, Muhammad Shouaib Mughal, wanted to join up with militants and they found the way through the 17-year-old nephew of a Pakistani Taliban leader who they met at the Red Mosque.
Both Hussain and Mughal have been arrested by Pakistani authorities.
"They want to do something, but they don't know what to do," said a person familiar with the case.
"They are searching for anybody who can give them the opportunity."
The indictment against Shahzad said that he was trained in Pakistan by affiliates of Tehrik-i-Taliban and prosecutors claim that he got money from the extremist outfit.
The Tehrik-i-Taliban operatives, however, first thought that Shahzad was a spy but after finding out about his American passport wanted him to carry out an attack inside the US.
During training, he met briefly with the Pakistani Taliban leader Hakimullah Mehsud, according to the newspaper.
In court on Monday, Shahzad told the judge that after becoming a US citizen, last year, he went back to Pakistan in June to first meet with his family and then headed to Peshawar where he received bomb training from Tehrik-e-Taliban and cash.
Shahzad retuned to the US in February and more money followed in March and April.
Shahzad admitted building three explosive devices in his home in Connecticut and said that he did not know why they did not explode."I was waiting to hear a sound, but I couldn't hear any sound, so I thought it probably didn't go off. So I just walked to the Grand Central and went home," Shahzad said.