Two young men living in Brooklyn were arrested on Wednesday and charged with plotting to travel thousands of miles to fight under the banner of the Islamic State, the terrorist organization that has seized a wide expanse of Syria and Iraq.

A third Brooklyn man was charged with helping organize and fund their activities.

Even as the Islamic State has been waging a brutal war in the Middle East, it has been spearheading an aggressive campaign to recruit Muslims to its cause, using social media to target young people across the world.

It has drawn thousands of fighters from nearby nations, tapping into a range of resentments, such as political oppression and personal disillusionment. More recently, the group has found scores of willing recruits in Europe, many inspired by the group’s gruesome videos of atrocities.

Now, the authorities say, its reach has extended into New York, to three men drawn by its apocalyptic message.