NEW YORK (Reuters) - Three men and a teenager have been arrested after planning to bomb a Muslim community in upstate New York, and investigators have recovered three homemade bombs and nearly two dozen guns, authorities said on Tuesday.

The alleged plot was uncovered after a student at Odyssey Academy, a school in Greece, New York, showed a classmate a photograph of another student and said, “He looks like the next school shooter, doesn’t he?” Greece Police Chief Patrick Phelan told reporters at a news conference.

The remark was reported to school security, which along with local police interviewed both the student who had the photograph as well as the student in the picture.

The investigation eventually led police to execute several search warrants and arrest four people, including the student who showed off the photograph.

The group had planned to attack Islamberg, a small enclave in the Catskill Mountains about 150 miles northwest of New York City. The town was founded more than three decades ago by a group of black Muslims who follow the teachings of Pakistani Sufi cleric Mubarik Ali Shah Gilani.

Brian Colaneri, 20, of Rochester; Andrew Crysel, 18, of East Rochester; and Vincent Vetromile, 19, face weapons and conspiracy charges. The student, who is 16, was charged with the same offenses but was not identified due to his age.

It was not immediately clear whether the defendants had attorneys.

The three improvised explosive devices were found at the teenager’s house, Phelan said. The weapons were all legally owned shotguns and rifles.

“If they had carried out this plot, which every indication is that they were going to, people would have died,” Phelan said. “I don’t know how many and who, but people would have died.”

Police declined to provide details about how the investigation into the student’s seemingly offhand remark led to the arrests.

Three of the four defendants were in the Boy Scouts together, Phelan said.

Islamberg has been targeted in the past. Two years ago, a Tennessee man was sentenced to nearly 20 years in prison for plotting to attack the enclave.