A New Jersey man will spend 16 years in prison and the rest of his life under supervision for a plot to make and detonate a pressure cooker bomb in New York on behalf of ISIS, the Department of Justice announced Friday.

Gregory Lepsky, 22, of Point Pleasant, N.J., pleaded guilty last year to attempting to provide material support to a terrorist organization for the plot.

Lepsky was arrested in 2017 after stabbing the family dog, and authorities found the pressure cooker in his bedroom closet. He had obtained bomb-making instructions, the pressure cooker, and the other items for the attack via the Internet.

According to a release from the DOJ, Lepsky was in contact over social media with others who knew of his plan, telling them he wanted to fight for ISIS and was willing to become a martyr by driving a “bunch of explosives” to where the “enemies” could be found and blowing himself up.

Authorities also found a message from another terrorist sympathizer that said a Westerner who could not travel to Syria to fight for the extremist organization could conduct a terrorist attack at home using an improvised bomb.