NEW YORK CITY: When Ahmed Abassi arrived in the United States for the first time in March 2013, the Tunisian student settled into a historic, neo-Gothic apartment building in Manhattan’s Financial District.

Unknown to him, the apartment was wired with audio recording devices, and Abassi’s American host was an undercover FBI agent. Abassi, then 26 and suspected of terrorism ties, had landed in an FBI sting, part of an elaborate operation that stretched from New York to Quebec City to a small town in Tunisia.

Abassi was caught on tape discussing “the principle that America should be wiped off the face of the earth,” with people he believed to be co-conspirators, one of whom was the FBI agent, according to court records. At one point, Abassi suggested “putting bacteria in the air or in a water supply.”

But last month, Abassi, who declined to be interviewed, pleaded guilty to relatively minor charges that did not include any terrorism enhancements that could have sent him to prison for years, and he is not contesting a deportation order.

The case was a rare setback for the FBI, which has successfully targeted suspected terrorists using sting operations, typically ending with the defendants about to embark on what they believe is a terrorist attack with fake weapons or bombs supplied by the bureau. Guilty verdicts and long prison sentences follow.

According to a recent report by Human Rights Watch, nearly 50 percent of the more than 500 federal counterterrorism convictions since the Sept. 11, 2001, attacks have “resulted from informant-based cases; almost 30 percent of those cases were sting operations in which the informant played an active role in the underlying plot.”

Among the more prominent prosecutions, a Moroccan man was convicted for planning a suicide bombing at the US Capitol in Washington. Amine Mohamed El Khalifi, an illegal immigrant who lived in Alexandria, Virginia, was arrested wearing a suicide vest that he believed to be real and had been provided by undercover FBI agents. In Portland, a Somali-American was convicted of planning to remotely detonate an 1,800 pound bomb at a Christmas tree lighting ceremony. The device was, in fact, inert and had been supplied by the bureau. In one 2009 case, the FBI arrested a group of men in New York state — the “Newburgh Four” — and charged them with plotting to blow up a pair of synagogues in the Bronx with fake bombs provided by an informant.

“The government pursues people with mental or intellectual disabilities or people who are desperately poor with an aggressive informant or undercover agent to get them to agree to commit terrorist acts,” said Andrea Prasow, deputy director of Human Rights Watch’s Washington office.