Spanish law enforcement officials have broken up a cybercrime gang made up of Ukrainians and Russians that allegedly stole more than €1 billion from financial institutions worldwide during a five-year spree.

According to statements issued by the Spanish police and Europol, the leader of the gang is a Ukrainian national, identified as “Denis K.” His three main accomplices are Russian and Ukrainian citizens, all of whom have been identified and arrested in the Spanish city of Alicante.

In Ukraine, police said that an unidentified 30-year-old man linked to the gang was cooperating with authorities.

The hackers — whose activities have long been tracked by security researchers — used malware to target more than 100 financial institutions worldwide, sometimes stealing up to €10 million in each heist. Almost all of Russia’s banks were targeted, and about 50 of the financial institutions lost money during the gang’s electronic robberies, Spanish authorities said.

The gang employed well-worn techniques using virus-containing emails to break into banks and compromise the internal networks that control ATMs, effectively turning the machines into free cash dispensers.

Authorities said the gang converted its illicit gains into bitcoins and used the cryptocurrency to purchase big-ticket items, including houses and vehicles in Spain.

The hackers’ modus operandi followed a familiar formula often used by hackers from post-Soviet republics – bank workers would be targeted with emails that claimed to be from legitimate companies. The malware attached to the email would give the hackers control over the compromised computer as well as access to the bank’s internal security network.