A global cybercime ring stole $45 million from banks around the world in a matter of hours by hacking a database of prepaid debit cards, federal prosecutors said Thursday.

Seven people are in U.S. custody in connection with the case, which prosecutors said involved thousands of thefts from ATMs using bogus magnetic strip cards. Data stolen during two separate intrusions at credit card processors was used to make more than 40,500 withdrawals in 27 countries during two separate incidents in December and February, prosecutors said.

Eight people in New York have been charged with participating in the conspiracy by stealing $2.8 million from ATMs in the New York area in a matter of hours, according to U.S. Attorney Loretta E. Lynch, who announced the charges Thursday. The charges focus on the New York cell of the scheme, which is believed to have been headquartered outside the U.S., but prosecutors are trying to determine whether there were other U.S.-based cells.

"The defendants and their co-conspirators participated in a massive 21st-century bank heist that reached across the Internet and stretched around the globe," Lynch said in a statement. "In the place of guns and masks, this cybercrime organization used laptops and the Internet."

The defendants eliminated the withdrawal limits from accounts at two Middle East banks during the intrusions and then fanned out across multiple cities, using old hotel keys or expired credit cards encoded with the correct account information and access codes to quickly drain ATMs. The cells would then take a cut of the heist, laundering the cash through expensive purchases and then shipping the money to the ringleaders, Lynch said.

"Moving as swiftly as data over the Internet, the organization worked its way from the computer systems of international corporations to the streets of New York City, with the defendants fanning out across Manhattan to steal millions of dollars from hundreds of ATMs in a matter of hours," Lynch said.

The December ATM blitz reaped $5 million worldwide, while the February attack netted $40 million from 36,000 transactions carried out in 10 hours, prosecutors said. The attack, which was carried out in Japan, Canada, Germany, Romania, and other countries, focused on funds held by two banks, Rakbank in the United Arab Emirates and the Bank of Muscat in Oman, prosecutors said. Individual accounts were not affected.

Surveillance cameras showed one of the defendants moving from ATM to ATM, his backpack growing increasingly loaded with cash. Others photographed themselves with wads of cash as they roamed Manhattan streets, Lynch said.

The seven defendants -- U.S. citizens originally from the Dominican Republic -- were charged with conspiracy and money laundering. They face up to 10 years in prison if convicted. The eighth defendant named in the indictment is the suspected ringleader of the cell who was murdered in the Dominican Republic in April.

ATM hack indictment