MADRID—Spanish police arrested three suspected computer hackers who allegedly belonged to a loose-knit international activist group that has attacked corporate and government websites around the world, authorities said Friday.

A National Police statement identified the three detainees as leaders of the Spanish section of a group that calls itself “Anonymous.”

A computer server in one of their homes was used to coordinate and carry out the cyber attacks on targets including two major Spanish banks, the Italian energy company Enel and the governments of Egypt, Algeria, Libya, Iran, Chile, Colombia and New Zealand, the statement said.

The statement said the only other countries to act against “Anonymous” so far are the United States and Britain. It attributed this what it called complex security measures that members use to protect their identity.

The suspects in Spain were arrested in Barcelona, Valencia and the southern city of Almeria, the statement said without specifying when the detainees were picked up.

Since October 2010, Spanish police specializing in cyber crime have analyzed more than two million lines of online chat and Internet pages until they finally zeroed in on the three suspects. Their names were not given.

In January, British police arrested five young males on suspicion of involvement in cyber attacks by Anonymous, which has backed WikiLeaks.

“Anonymous” has claimed responsibility for attacking the websites of companies such as Visa, Mastercard and Paypal, all of whom severed their links with WikiLeaks after it began publishing its massive trove of secret U.S. diplomatic memos.

“Anonymous” accused the companies of trying to stifle WikiLeaks and rallied an army of online supporters to flood their servers with traffic, periodically blocking access to their sites for hours at a time.

And in February, an Internet forum run by “Anonymous” directed participants to attack the websites of the Egyptian Ministry of Information and the ruling National Democratic Party.

In a Twitter post, the group claimed credit for taking down the ministry’s website and said the group was motivated by a desire to support Egyptian pro-democracy protesters.