A UBS employee has been charged with embezzling SFr48 million ($32 million), and using some of the cash to prop up his football club.
The investigating magistrate said Andreas Hafen, president of FC Wil, had confessed to siphoning off the money over a ten-year period.
Hafen's club recently jumped to third place in the Swiss league, after years of obscurity.
The investigating magistrate Martin Frey said that Hafen, 40, started embezzling small amounts of money in the early 1990s from UBS's St Gallen branch in northern Switzerland.
He said Hafen had set up fictitious accounts and investment funds for clients and managed to evade UBS internal security procedures.
UBS spokesman, Rudolf Bürgin, told swissinfo that the reason Hafen had been able to siphon off money for so long without being detected was down to his high-ranking position at the bank.
"One has to bear in mind that Andreas Hafen had a relatively senior position at the bank - he was vice-director - and consequently he had a high degree of autonomy.
"He abused his position for criminal purposes and to sabotage the security systems that were in place."
Bürgin said Hafen had used a variety of methods to embezzle the funds. One was to open fictitious accounts, and then authorise loans to the holders of these accounts.
He told swissinfo that the bank was tipped off by the authorities that something was amiss. "We started an internal investigation... and it was immediately clear that criminal activity had been taking place.
He added that UBS has yet to decide whether to action to take against the bank. The whereabouts of the money not given to the football club is unclear.
The magistrate said that initially Hafen had used the cash to pay off personal debts, but that four years ago he started diverting money into FC Wil under the guise of donations and sponsorship deals.
Other club officials were kept completely in the dark about the origin of the funds - totaling SFr10 million - and suspected nothing.
Hafen was arrested earlier this month after the fraud was uncovered on November 14. He was provisionally released on Thursday because authorities said they saw no risk that he would flee the country.
There was no immediate reaction from Hafen or his lawyers, but the club said it was surprised at the size of the funds involved - and that it would be hard pressed to repay the money.
"The money is gone. It's been spent on salaries and club costs," said Heinrich Hofmann, who has been running the club as interim president since Hafen's arrest.
He added that FC Wil was fighting for its survival and it was now searching for new sponsors.
swissinfo with agencies
Hafen siphoned off the cash through fictitious accounts and investment funds.
UBS has yet to say if it will sue the club to recover the money.
The club recently jumped to third place in the Swiss league.
FC Wil's interim president said the club was searching for new sponsors.