Britain's biggest bank helped wealthy clients cheat the UK out of millions of pounds in tax, the BBC has learned.
Panorama has seen thousands of accounts from HSBC's private bank in Switzerland leaked by a whistleblower in 2007.
They show bankers helped clients evade tax and offered deals to help tax dodgers stay ahead of the law.
HSBC admitted that some individuals took advantage of bank secrecy to hold undeclared accounts. But it said it has now "fundamentally changed".
The documents, stolen in 2007 by a computer expert working for HSBC in Geneva, contain details of more than 100,000 clients from around the world.
Offshore accounts are not illegal, but many people use them to hide cash from the tax authorities. And while tax avoidance is perfectly legal, deliberately hiding money to evade tax is not.
The French authorities assessed the stolen data and concluded in 2013 that 99.8% of their citizens on the list were probably evading tax.
The thousands of pages of data were obtained by the French newspaper Le Monde. In a joint investigation, the documents have now been passed to the International Consortium of Investigative Journalists, theGuardian newspaper, Panorama and more than 50 media outlets around the world.
The documents include details of almost 7,000 British clients - and many of the accounts were not declared to the taxman.
HM Revenue and Customs (HMRC) was given the leaked data in 2010 and has identified 1,100 people who had not paid their taxes. But almost five years later, only one tax evader has been prosecuted.
HMRC said £135m in tax, interest and penalties have now been paid by those who hid their assets in Switzerland.
But the chairwoman of the Public Accounts Committee, Margaret Hodge MP, said: "I just don't think the tax authorities have been strong enough, assertive enough, brave enough, tough enough in securing for the British taxpayer the monies that are due."
HSBC did not just turn a blind eye to tax evaders - in some cases it broke the law by actively helping its clients.
The bank gave one wealthy family a foreign credit card so they could withdraw their undeclared cash at cashpoints overseas.
HSBC also helped its tax-dodging clients stay ahead of the law.
When the European Savings Directive was introduced in 2005, the idea was that Swiss banks would take any tax owed from undeclared accounts and pass it to the taxman.
It was a tax designed to catch tax evaders. But instead of simply collecting the money, HSBC wrote to customers and offered them ways to get round the new tax.
HSBC denies that all these account holders were evading tax.
Richard Brooks, a former tax inspector and author of The Great Tax Robbery, said: "I think they were a tax avoidance and tax evasion service. I think that's what they were offering. They knew full well that people come to them to dodge their tax liabilities."
The bank now faces criminal investigations in the US, France, Belgium and Argentina. HSBC said it is "co-operating with relevant authorities". But in the UK, where the bank is based, no such action has been taken.
Stephen Green served as a minister of trade and investment
The man in charge of HSBC at the time, Stephen Green, was made a Conservative peer and appointed to the government.
Lord Green was made a minister eight months after HMRC had been given the leaked documents from his bank. He served as a minister of trade and investment until 2013.
He told Panorama: "As a matter of principle I will not comment on the business of HSBC past or present."
HSBC said it has completely overhauled its private banking business and has reduced the number of Swiss accounts by almost 70% since 2007.
In a statement, the bank said: "HSBC has implemented numerous initiatives designed to prevent its banking services being used to evade taxes or launder money."
The bank said it now puts compliance and tax transparency ahead of profitability.
But Panorama has spoken to a whistleblower who said there were still problems with tax dodging at HSBC private bank when she worked there in 2013.
Sue Shelley was the private bank's head of compliance in Luxembourg. She said HSBC did not keep its promise to change. "I think the verbal messages were great but they weren't put into practice and that disturbed me greatly," she said.
It was her job to make sure HSBC followed the rules, but she said she was sacked after raising concerns. She has since won a tribunal hearing for unfair dismissal.
Watch Panorama: The Bank of Tax Cheats on February 9 at 20.30 GMT on BBC1.