WASHINGTON (Reuters) - U.S. authorities arrested a man in western New York and charged him with supporting Islamic State by traveling to Turkey to help the militant group, the Justice Department said on Wednesday.

Arafat Nagi, 42, of Lackawanna, New York, was charged with attempting to provide material support to a terrorist organization after the Federal Bureau of Investigation (FBI) discovered he had purchased military equipment and traveled to Turkey twice to meet with members of Islamic State.

“Thanks to the combined efforts of law enforcement and community members, this defendant is no longer capable of achieving his goal of joining the most despicable group of our time,” U.S. Attorney William Hochul told reporters.

Nagi had pledged allegiance to the Islamic State, court documents said. He traveled to Turkey in October 2012 and July 2014 with the aim of meeting with members of the group, according to the documents.

Among the gear Nagi is accused of purchasing prior to the trips were body armor, a machete and night vision goggles.

A resident of Lackawanna, about 370 miles northwest of New York City, last August told the FBI that Nagi regularly argued with residents about his beliefs, according to the complaint.

The resident said Nagi was angry about the killing of rebels in Yemen and blamed the United States for their deaths, the complaint said.

Nagi was due to appear in court in the Western District of New York on Wednesday. His charges carry a maximum penalty of 15 years in prison and a $250,000 fine.