Security officers found a device at Manchester Airport on 30 January.
Nadeem Muhammad, 43, who denies possession of explosives with intent, boarded another flight on 5 February, Manchester Crown Court heard.
Jonathan Sandiford, prosecuting, said Mr Muhammad intended to detonate a device on a Ryanair flight to Bergarmo.
Mr Muhammad, who was born in Pakistan but had an Italian passport, was questioned by police on 30 January but not arrested.
A swab of the device found revealed no traces of explosives.
Mr Sandiford said: "At that stage nobody had realised this was a real device and the defendant was allowed to go on his way."
He told the jury it was only on 8 February when the device was examined again that the bomb squad was called.
The explosive was sent to expert Lorna Philp, who found it was a "crude but potentially viable improvised explosive device".
The device was found to contain nitroglycerine, the trial heard.
Mr Muhammad, of Tinline Street, Bury, was arrested when he returned to the UK on 12 February.
Mr Sandiford said if wires protruding from either end of the tube had been connected to each other the device would have detonated and experts said it would have been "unreliable" and "unpredictable".
"The only reason he would have for trying to get that explosive device on to the aeroplane was that he intended to detonate it within the confines of the Boeing 737 aircraft."
He said the prosecution could not be sure if terrorism, suicide or "another purpose altogether" was the motive.
The device was found within the zip lining of a small green suitcase which Mr Muhammad was carrying, the court heard.
When initially questioned he said it may have been placed into his bag by his wife or another person.
Mr Muhammad denies possession of explosives with intent to endanger life or property and an alternative charge of possession of explosives under suspicious circumstances.
The trial continues.
A man accused of trying to smuggle a pipe bomb on to a plane flew again days later as police did not think the device was viable, a court has heard.