PARIS (Reuters) - France said on Friday it had thwarted a possible ricin attack after intercepting messages on the secure social media platform Telegram and a source in the Paris prosecutor’s office said an Egyptian-born student was in police custody.

Police raided the student’s residence in the capital’s densely populated 18th arrondissement on May 11 on suspicion he had links to criminal networks, the source said. Four days later he was placed under formal investigation and denied bail.

A second man who was arrested was later released. Interior Minister Gerard Collomb said the two were brothers, but the official in the prosecutor’s office said this was not the case.

“We’re following a number of people on (social media) networks. These two happened to be on Telegram,” Collomb told BFM TV. “We were able to trace them, identify this plot and stop them.”

Collomb said the student possessed “instructions on how to build ricin-based poisons.”

A week ago, a Chechen-born Frenchman went on a stabbing rampage in central Paris, killing one person before police shot him dead, an attack that again exposed the difficulty European intelligence services face in keeping track of suspected extremists.

More than 240 people have been killed on French soil over the past three years in attacks launched by Islamist militants or individuals inspired by groups like Islamic State.