BERLIN (Reuters) - German police on Wednesday detained a Russian man suspected of planning a bomb attack in Germany after turning to radical Islam, prosecutors said.

A general view shows an appartment building in Berlin, Germany, believed to house a flat of a Russian man suspected of planning an attack using explosives after turning to radical Islam, the General Prosecutor's Office (GBA) said on August 22, 2018 detained . REUTERS/Hannibal Hanschke

Police said the 31-year-old suspect, named as Magomed-Ali C. under German privacy rules, had acted together with a French national, Clement B., who was detained in Marseille, France, in April last year.

Magomed-Ali C., arrested in a raid on his apartment in Berlin, had stored large quantities of the explosive triacetone triperoxide or TATP in October 2016, a statement by the General Prosecutor’s Office said.

An unstable homemade explosive, TATP has been used by militants in several attacks in western Europe, including in Manchester, Britain, in May last year, Brussels in 2016 and Paris in 2015.

The suspect had planned to detonate the device at an unspecified location in Germany to kill and injure a maximum number of people, the statement said.

Clement B., who public prosecutors said had been in contact with a Tunisian man who killed 12 people in an attack in Berlin in December 2016, is accused of planning an attack using explosives with another French national, also now under arrest.

The two Frenchmen had met while sharing a cell in prison and were known to police as having turned to radical Islam, French prosecutors said last year.

German police took measures in October 2016 to stop efforts by Clement B. and Magomed-Ali C. to plan an attack, German prosecutors said. The prosecutor’s statement did not say why Magomed-Ali C. was not arrested at the time.

Fearing police detection, the two suspects decided to part ways and Clement B. left Germany for France at the end of October 2016.

Magomed-Ali C. will appear before a judge on Thursday when prosecutors said they will request he be kept in custody.

Frauke Koehler, senior public prosecutor and spokeswoman for the federal prosecutors office, told reporters Magomed-Ali C. had visited a mosque in Berlin that was also attended by Anis Amri, a Tunisian with Islamist militant ties who killed 12 people in the attack in Berlin in 2016, when he hijacked a truck and drove it into a crowded marketplace.

“So it’s obviously possible that the paths of Magomed-Ali C. and Anis Amri crossed there,” Koehler said, adding that Amri had been in contact with Clement B., who she said was also said to have visited the mosque.

“We have no indications that Magomed-Ali C. or Clement B. were involved in the Berlin Christmas market attack,” she added.