Flavien Moreau travelled to the conflict-ridden country at the end of 2012 but says he only managed to stay "a dozen days" as he was unable to stand a strict ban on smoking imposed by the Islamist militants he was with.
On his return, he was placed under surveillance by French anti-terrorist authorities who eventually detained him in January 2013 after hearing him say he was looking for fake ID to go back to Syria.
He converted to Islam after getting out of prison, quickly became radicalised, went to study Arabic in Egypt and eventually decided to go to wage jihad in Syria.
He told the courtroom that he found a smuggler who took him to a Syrian village controlled by Islamist militants where he bought a Kalashnikov and munitions.
Also Read
But he denied having done any fighting, saying he had only taken part in surveillance and policing.
He returned to France to buy an electronic cigarette before attempting to go back to Syria.
But he kept being turned back at airports in Tunisia, Lebanon, Bulgaria or Germany, which is when he decided to get fake ID, prompting his detention.
When under surveillance on his return, investigators also found he was in regular contact with a 26-year-old man called Farid Djebbar, who was also put on trial.
Investigators also found files on his computer containing jihadist videos, as well as searches on how to make a home-made bomb, on Al-Qaeda or Al-Qaeda in the Islamic Maghreb (AQIM), and two that contained the words "meet Francois Hollande" and "Francois Hollande's movements."
Djebbar was sentenced to four years in jail.