Police in France have foiled a suspected terror attack and handed preliminary terrorism charges to a man of Egyptian origin.

Earlier, French interior minister, Gerard Collomb said that two men had been arrested for "preparing to commit an attack, with either explosives or ricin, this very powerful poison".

He said police identified the two suspects while tracking extremist activity on social networks.

"They had tutorials that showed how to make ricin-based poisons," Mr Collomb told BFM TV, adding that they had communicated via the Telegram encrypted messaging application.

"We were able to detect them, detect this attack plan and were able to arrest them," he said.

It is unclear how police were able to decipher their Telegram exchanges given its reputedly impenetrable nature.

Later, judicial sources said one of the men was released without charged. The other, a 20-year-old student and illegal immigrant known only as Mohamed M, ran a "particularly active account in the pro-jihadist sphere", said the source.

Police raided his flat and found a stash of gunpowder taken from bangers as well as a computer containing bomb-making tutorials, as well as a video on how to use ricin.

During questioning, the suspect "spontaneously acknowledged having consulted jihadist propaganda and explained that an as yet unidentified individual on the encrypted messaging app Telegram told him to buy the stock of bangers to make a bomb and to take action in France," he said.