Najibullah Zazi faces life in prison without parole
An Afghan-born Colorado airport bus driver has pleaded guilty to plotting to blow up New York's subway system.
Najibullah Zazi told a federal court in the city that he had been planning what he called a "martyrdom operation".
Zazi pleaded guilty to conspiracy to use weapons of mass destruction, conspiracy to commit murder and providing material support to al-Qaeda.
US Attorney General Eric Holder said the plot was one of the most serious threats to the US since 9/11.
Twenty-five-year-old Zazi changed his plea from one of not guilty. He faces a sentence of life in prison without parole.
Zazi said he had agreed to carry out the attack as a protest against American military operations in his homeland, Afghanistan.
The US intelligence community has been under pressure ever since it failed to prevent an attack on an airliner bound for Detroit on Christmas Day, says the BBC's Matthew Price in New York.
'We will not rest'
Mr Holder said the US intelligence community had foiled what could have been a "devastating" attack.
US Attorney General Eric Holder: "It would have been deadly"
"This was one of the most serious terrorist threats to the nation since September 2001," he said, adding that there was no doubt American lives had been saved.
The plotters spent months planning to attack the subway.
The US Department of Justice said Zazi flew to Pakistan in 2008 with a view to fighting for the Taliban.
But he was recruited and trained by al-Qaeda on the Afghan-Pakistani border, and then dispatched back to the US armed with the knowledge to attempt an attack on the New York subway system.
Last September he rented a car in Denver, Colorado, and made the long drive to New York.
With him, he brought homemade explosives, planning to assemble the bombs over the weekend, and hit the subway just after the anniversary of the 11 September attacks.
Mr Holder said Zazi was under surveillance throughout his trip, and the investigation was ongoing.
"We will not rest until everyone responsible is captured," he said.
"We are at war with a very dangerous, intelligent and adaptable enemy and we must use every weapon we have to win that war."
Another two suspects - Adis Medunjanin and Zasrein Ahmedzay - said to be associates of Mr Zazi - were arrested over the plot last month.