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.

READ MORE: NYS Senate Majority Leader Andrea Stewart-Cousins Calls Sexual Harassment Claims Against Gov. Andrew Cuomo 'Extremely Disturbing'

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!”

READ MORE: New York City Schools Chancellor Richard Carranza Stepping Down

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.

MORE NEWS: Long Island Man Shocked By Amazon's Response After He Found Undelivered Packages On Side Of Road; 'It's Not My Stuff To Keep'

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.