A student cleared of being the “third man” in the Charlie Hebdo attack in Paris has been arrested for allegedly trying to join Isil in Syria.

Mourad Hamyd, 20, the brother-in-law of one of the two Kouachi brothers, who murdered 12 people in and around the office of the satirical magazine in January last year, was initially suspected of being their getaway driver.

The quiet, polite young man surrendered to police in his home town of Charleville-Mézières in eastern France and was questioned over two days. A huge social media campaign protesting his innocence and alibis from his classmates led to his release without charge.

Hamyd remained on a terrorist watch list, but appeared to be a model student, passing his baccalauréat, equivalent to A-levels, five months later. He spoke of his shock that his name had been linked to “barbaric crimes”, saying he hoped it would not spoil his future.

Hamyd had completed his first year at university when his family reported him missing on July 25. Three days later, he was turned back as he allegedly tried to enter Turkey. He is now in custody in Bulgaria, it emerged on Sunday.

He managed to slip out of France undetected by French security agencies despite being on the watch list. The contents of his travel bag — a uniform, heavy shoes and gloves — seem to indicate that he was a “candidate for jihad” rather than a visitor planning to sunbathe on a Turkish beach, French intelligence sources told the Journal du Dimanche newspaper.