ZURICH (Reuters) - A Swiss watchdog defended federal prosecutors on Wednesday from allegations that they inadvertently blew the cover of a spy detained in Germany last month on suspicion he was gathering intelligence about sales of stolen Swiss bank data.

In a case that has triggered outrage in Germany, the man identified only as Daniel M. was taken into custody in April and charged with investigating how German authorities came up with data identifying German tax dodgers with Swiss accounts.

The 54-year-old suspect was also under investigation in Switzerland on unrelated allegations that he was dealing in stolen bank data himself via German middlemen.

Media reports say unredacted interrogation records in which Daniel M. told Swiss police about his spy activity in Germany fell into the hands of German prosecutors when lawyers for two German suspects in that case were given access to the files.

Daniel M.’s lawyer has also criticized prosecutors at the Swiss Office of the Attorney General (OAG).

The AB-BA agency that oversees the OAG said only a court could decide whether this particular case was handled appropriately but that in general it was important for defendants in criminal cases and their legal representatives to see such files.

“If the OAG had decided to black out the passages in the files and thus conceal D.M.’s professed mission for the NDB (intelligence agency) it would have massively impaired not only the rights of the suspects but also the search for the truth,” it said in a statement.

The Swiss government has acknowledged that police asked the NDB in 2011 to help with an investigation related to the stolen data in Germany. But it has declined to give more details.

The German state of North Rhine-Westphalia has for years irritated Switzerland by buying data as part of a crackdown on Germans stashing cash in secret accounts to avoid paying tax.

The state has spent 17.9 million euros ($19.9 million) since 2010 on data that has helped it recover nearly 7 billion in tax revenue.