A man who arrived at a British airport for a flight with a pipe bomb in his hand luggage has been sentenced to 18 years in prison.

Manchester Airport security staff found the device inside Nadeem Muhammad's bag on Jan. 30. It contained gunpowder and batteries inside a marker pen tube.

The 43-year-old denied wrongdoing, saying the bomb must have been planted by someone else. But prosecutors said he planned to detonate it during a Ryanair flight to Italy.

He was convicted this month of possessing explosives.

Sentencing Muhammad Wednesday, judge Patrick Field criticized airport staff for making a "wholly erroneous and potentially dangerous" conclusion that the bomb wasn't viable.

Muhammad wasn't arrested when he was initially stopped, and was allowed to fly to Italy several days later.