A French intelligence agent sent a text message by mistake to the mobile phone of a jihadist, inadvertently warning him that he was under surveillance and undermining an investigation, it emerged on Friday.

The target of the probe, described as an “Islamist preacher” based in the Paris area, immediately understood that his phone was being tapped and his movements monitored.

He called the agent to complain and warned his contacts that they were under surveillance. As a result, separate investigations by two different intelligence services came to nothing, M6 television reported.

“It was undoubtedly the worst mistake the agent ever made,” M6 commented. Interior ministry sources confirmed the report.

The intelligence officer had meant to send the text to a colleague last Saturday. It contained information about the Islamist and the progress of the investigation.

It was only when the Islamist decided to have some fun at the officer’s expense and phoned him minutes after he sent the text that he realised what he had done.

The two agencies involved, the Central Territorial Intelligence Service and the General Directorate for Internal Security, were furious over the mishap.

The incident came as France remains under a state of emergency declared after the 2015 Paris terrorist attacks.