Germany's domestic intelligence agency (BfV) has discovered an Islamist working within its own ranks, according to domestic media reports on Tuesday. The case allegedly surrounds a 51-year-old German who planned to bomb the BfV headquarters in Cologne.

Officials say the man was active on extremist websites. Using a pseudonym, he gave away secret information, allegedly gathering information on the times and details of raids against extremists. News outlet "Der Spiegel" wrote that the man's family was not even aware he had converted to Islam in 2014.

Having previously worked at a bank, the man joined the BfV in April 2016 - joining a new task force monitoring the ever-growing Salafist scene in Germany.

"Die Welt" newspaper reported that he had also boasted about having a plan in place to carry out an attack on his place of work, though according to authorities he did not appear to have yet taken any concrete steps into carrying it out.

He wrote online that such an attack against "unbelievers" would be "for Allah's purpose."

The father of four had been under surveillance for about four weeks before an arrest warrant was issued for him and he has been detained, the prosecutor's office in Düsseldorf, the state capital of North Rhine-Westphalia, said.

A spokeswoman from the BfV confirmed the case to French news agency AFP, but said there was no danger to the agency or its employees. She added that the man had "behaved inconspicuously" during his training and brief term of employment.