BOSTON — A computer hacker has been sentenced to 20 years in prison for helping engineer one of the largest thefts of credit and debit card numbers in U.S. history.

U.S. District Judge Patti Saris today sentenced Albert Gonzalez of Miami, who pleaded guilty last year to breaking into computer systems of major retailers, including Hannaford Bros., TJX Cos. and BJ’s Wholesale Club.

Prosecutors had sought 25 years for Gonzalez, saying he victimized millions of people and cost companies, banks and insurers nearly $200 million. His lawyer had argued Gonzalez should get no more than 15 years.

Gonzalez pleaded guilty last year in three separate hacking cases brought in Massachusetts, New Jersey and New York. The Thursday hearing dealt with the Massachusetts case. A second sentencing Friday also in Boston will deal with the others, including the Hannaford Bros. case.