A former New York City high school teacher and his brother have been arrested and charged with attempting to build an explosive device after an investigation by the FBI, according to authorities.

Christian Toro, the former teacher, and his twin brother Tyler Toro, both 27, had stockpiled materials for making bombs in the apartment they shared in the city's Bronx borough, according to a criminal complaint and New York deputy police commissioner.

Law enforcement agents, in a search of the brothers' apartment, found a backpack with an index card reading, "Under the full moon the small ones will know terror," the complaint said.

Agents also found a book that appeared to be a diary with Tyler Toro's name on it, with a line saying, "We are twin Toros strike us now, we will return with nano thermite," the complaint said.

Officials said there was no evidence of any ongoing threat.

"We have no indication that there's a continued threat posed by these individuals," the assistant director of the New York FBI office, said at a news conference.

Christian Toro was a teacher at a high school in Manhattan's Harlem before resigning last year.

When he left the job, Tyler Toro returned to the school a computer that had been provided to his brother, and staff found instructions on it for building explosive devices, according to the complaint.

Investigators said Christian Toro told them he had found the document while researching the 2013 Boston Marathon bombing and never read it or had built a bomb, according to the complaint.

About a week later, investigators interviewed students at the school who indicated that at least two students at the school had been paid about $50 an hour to break apart fireworks and store powder for the two men, the complaint said.

A search of the brothers' apartment yesterday found potassium nitrate, black powder identified as an explosive material, metal spheres and other potential bomb components, according to the document.

The US attorney in Manhattan said the two brothers were charged in federal court.

Christian Toro was charged with two counts of unlawful manufacture of a destructive device and distribution of explosive materials to a minor. Tyler Toro was charged with unlawful manufacture of a destructive device.

Both men pleaded not guilty. Authorities said they are being detained pending a bail hearing on 21 February.