The Spanish police said on Friday that they had apprehended three men suspected of computer hacking in connection with recent attacks on Sony’s PlayStation Network as well as corporate and government Web sites around the world.

The National Police identified the three as the local leadership of the shadowy international network of computer hackers known as Anonymous, which has claimed responsibility for a wide variety of attacks.

Anonymous is composed of people from various countries organized into cells that share common goals, the police said, with activists operating anonymously in a coordinated fashion.

One of the three suspects, a 31-year-old Spaniard, was detained in the southern Spanish city of Almería sometime after May 18, the police said. He had a computer server in his apartment in the northern Spanish port city of Gijón, where the group is believed to have attacked the Web sites of the Sony PlayStation online gaming store.