BUFFALO, N.Y. (AP) — A New York man has been sentenced to 15 years in prison for trying to join the Islamic State group, despite telling the judge he only wanted to provide humanitarian aid to Syrians.

The U.S. District Court judge told Arafat Nagi (NAH'-gee) on Monday he found his humanitarian claims hard to believe in light of graphic social media posts of Islamic State violence and a photo of Nagi posing with an assault rifle.

The 47-year-old Lackawanna (lak-ah-WAH'-nah) man traveled to Turkey in 2012 and 2014 and was planning another trip at the time of his 2015 arrest. He pleaded guilty to attempting to provide material support to a terrorist organization.

Prosecutors say Nagi's public posts and purchase of military gear made clear his intention to fight for the Islamic State group.