UBS said they had reached a settlement with German prosecutors, accepting a record fine of €300 million to be paid to the German tax authorities.
The bank said it was glad to end the dispute, which originated when its clients' private financial data began to find its way into the hands of German tax investigators in 2007.
"The agreement is a significant step which allows UBS to look to the future in this important market," said the bank in a statement buried within its quarterly figures release.
German investigators have in the past used inventive methods to piece together UBS client data bought from anonymous internal sources, including using mobile phone photos taken of PC screens.
In 2012 authorities in North Rhine-Westphalia bought a CD containing comprehensive stolen data on German UBS clients suspected of tax evasion on which they were able to build a case against UBS.
As well as names and account data, the disc reportedly also contained advice on how to evade the German tax man, which the bank is suspected of handing out to customers all over Europe.
The settlement comes less than a week after UBS was charged with tax fraud in Paris for allegedly helping rich French clients to hide money in Switzerland.
SEE ALSO: Market watchdog Bafin probing UBS unit