A Bangladeshi man who tried to blow up the Federal Reserve Bank in New York with what he thought was a 1,000-pound bomb, only to discover that the bomb was a fake and that he had been under constant federal surveillance, was sentenced to 30 years in prison on Friday.

The man, Quazi Mohammad Rezwanul Ahsan Nafis, 22, came to the United States in January 2012 on a student visa with plans to carry out a terrorist attack, carrying instructions on how to make a bomb out of household items, as well as audio recordings of Anwar al-Awlaki, an American-born radical cleric killed by an American drone strike in 2011. Mr. Nafis tried to find assistance and camaraderie on the Internet, but his efforts led him instead to an F.B.I. informer, who in turn introduced him to an undercover agent.

The agent met repeatedly with Mr. Nafis beginning last summer. In a sting operation, months long, Mr. Nafis developed his plot from a vague idea to a detailed plan to bomb the financial district, an attack that he hoped would “shake the whole country,” according to recorded statements he made during the investigation.

Similar cases, in which law enforcement officials have provided suspects with support and some materials needed to carry out an attack, have drawn criticism from those who believe that many of the subjects would have been unable to pull off their schemes without help from the government.