A Swiss man has been given a 22-month suspended sentence for spying on German tax officials.

The 54-year-old, identified only as Daniel M. in line with privacy rules, had confessed to a Frankfurt court that he received 28,000 euros ($33,000) from Switzerland's NDB spy agency to obtain information on tax officials in the German state of North Rhine-Westphalia between July 2011 and February 2015.

The court took into account his confession in handing M. a suspended sentence Thursday, and ordered him to pay 25,000 euros.

Prosecutors alleged that M. was tasked with identifying German tax investigators who obtained a data CD containing confidential Swiss bank client data and used it to open multiple tax-evasion prosecutions.