A young Canadian convicted of plotting terrorist attacks in New York City has been sentenced to 40 years in prison.

His lawyer says the sentence was handed down to 20-year-old Abdulrahman El Bahnasawy on Wednesday.

The stiff punishment comes despite defence arguments El Bahnasawy was entrapped.

His family also says he has suffered from severe psychiatric illness.

Prosecutors had called for a life sentence.

They have said El Bahnasawy was living at home in a Toronto suburb when he began online correspondence with a high-level ISIS recruiter.