Muslim convert Mustafa Abdullah was taken into custody last year when he landed at London's Gatwick Airport.
Police found gun instruction and guerrilla training videos on his phone and computer. One photo showed him carrying an assault rifle.
Judge Gerald Gordon said the materials amounted to "a veritable reference library" reflecting Abdullah's interest in guns and radical Islam.
The 34-year-old Abdullah had been convicted of a similar offense in the past.
He claimed during his trial to be working for Britain's intelligence service but was convicted of 13 offenses.