A hacker who pulled off one of the biggest credit and debit cards scams in U.S. history was sentenced to 20 years behind bars Thursday.

A hacker who pulled off one of the biggest credit and debit cards scams in U.S. history was sentenced to 20 years behind bars Thursday.

Albert Gonzalez, known online as "SoupNazi", pleaded guilty last year to hacking into the computer systems of Heartland Payment systems, which handled credit card processing for stores like TJ Maxx, BJ's Wholesale Club, Barnes & Noble, OfficeMax, and Boston Market, according to ABC News.

With the information in hand, Gonzalez drove by the physical stores, accessed their wireless Internet signals, and planted a Trojan Horse program that he used to credit card data. He stole more than 40 million credit card account numbers, and re-sold them to international clients via Web chats, the Financial Times reports.

Working with other scammers here and overseas, Gonzalez wracked up about $200 million in damages, and personally took home about $2.8 million.

The 20-year sentence, the longest ever for hacking, was handed down for stealing and selling the credit card information. A second sentence  for hacking into Heartland Payment  will be handed down today, but is expected to be served concurrently. The Heartland hack, FT says, cost an additional $130 million in damages.