NEW YORK (CBSNewYork) — One of three men who plotted terrorist attacks in New York City in the name of ISIS, setting their sights on Times Square, subway stations and concert venues, has been sentenced to 40 years in prison.

Abdulrahman El Bahnasawy, 20, a Canadian citizen, planned to detonate explosive devices in Times Square and the subway system, and shoot people gathered at concerts, according to Southern District of New York U.S. Attorney’s Office.

El Bahnasawy bought bomb-making materials but was arrested in May 2016 after traveling from Canada to New Jersey to stage the attacks, authorities said. His arrest came following an investigation in which an undercover FBI agent posed as an Islamic extremist.

According to criminal complaints, El Bahnasawy sent the undercover agent an image of Times Square with a smartphone message saying, “We seriously need to car bomb Times Square. Look at these crowds of people!”

In another, El Bahnasawy expressed a desire to “shoot up concerts cuz they kill a lot people. … We just walk in with guns in our hands. That’s how Paris guys did it,” the complaints said.

The complaints did not name the venues.

El Bahnasawy pleaded guilty in October 2016, but the case was sealed while the investigation continued.

A U.S. citizen, 19-year-old Talha Haroon, was arrested in Pakistan in 2016. Russell Salic, 37, was arrested in the Philippines last April.