Jose Pimentel, who police say was a follower of late Muslim cleric Anwar al-Awlaki, was arraigned Sunday night in state court on terrorism-related charges.
``We had to act quickly because he was in fact putting this bomb together,'' said Police Commissioner Ray Kelly.
Pimentel admitted he ``took active steps to build the bomb, including shaving the match heads and drilling holes in the pipes'' and was ``one hour away from completing it,'' said the criminal complaint filed by the Manhattan District Attorney.
Authorities called him a ``lone wolf'' who had converted to Islam and became a radical.
Pimentel, who has not been charged in federal court, faces life in prison if convicted.
He was under surveillance since May 2009 and considered New York police cars, a New Jersey police station and U.S. post office among his potential targets, officials said.
As a reader of the online magazine ``Inspire'' published by al Qaeda in the Arabian Peninsula, Pimentel took instructions from an article ``How to Build a Bomb in the Kitchen of Your Mom,'' Kelly said.
``We think an event that really set him off was the elimination of Anwar al-Awlaki,'' Kelly said. ``His actions became a lot more intense after Sept. 30.''
A U.S. drone strike killed Awlaki, a U.S. citizen, in Yemen in late September, ending a two-year hunt. U.S. intelligence called him the ``chief of external operations'' for al Qaeda's Yemen branch and a Internet-savvy propagandist.
He also talked about killing U.S. military personnel returning from Iraq and Afghanistan, the complaint said.
It said a police informant recorded meetings with Pimentel over several months and accompanied him as he bought materials for the bomb, including a drill and a clock.
Since the Sept. 11 attacks by al Qaeda in 2001, New York City has considered itself a prime target and has developed extensive intelligence and counterterrorism divisions that employ 1,000 officers within the police department.
No suspects have yet been convicted under New York state anti-terrorism laws passed after the attacks 10 years ago.
Mayor Michael Bloomberg called the Pimentel case the 14th plot against the city since 2001. Most of these have been deemed ``aspirational.'' But some, such as the failed May 2010 attempt to set off a bomb in Times Square, were closer to being carried out.
Counterterrorism officials in the United States and Europe say ``lone wolf'' militants are of particular concern because they can become radicalized via the Internet and prepare for an attack without leaving traces that might draw attention.