The company apologized to customers and offered free identity protection and credit monitoring services to those who had shopped in those 51 stores.
Backoff was discovered in October, but according to the Homeland Security Department the software wasn't flagged by antivirus programs until this month.
The news was the latest development in an ongoing battle between retailers and hackers.
Retail giant Target, based in Minneapolis, was targeted by hackers last year and disclosed in December that a data breach compromised 40 million credit and debit card accounts between Nov. 27 and Dec. 15. On Jan. 10, it said hackers stole personal information — including names, phone numbers and email and mailing addresses — from as many as 70 million customers.
Target, the third-largest retailer, has been overhauling its security department and systems in the wake of the pre-Christmas data breach, which hurt profits, sales and its reputation among shoppers worried about the security of their personal data. Target is now accelerating its $100 million plan to roll out chip-based credit card technology in all of its nearly 1,800 stores.
So-called chip and pin technology would allow for more secure transactions than the magnetic strip cards that most Americans use now. The technology has already been adopted in Europe and elsewhere.
On Wednesday, Target announced that its second-quarter earnings dropped 61.7 percent as it still reels from the cost of the breach as well as a botched Canadian expansion and sluggish sales.
The Backoff program itself is not unique. Like other malware designed to steal financial information from retail customers, the software gains access to companies' computers through insufficiently protected remote access points and duping computers users to download malware. But its wide deployment by hackers and its repeated updates over the last six months make it a serious threat for consumers and business.