The first legal battle against the UK's Government Communications Headquarters (GCHQ) has begun, as a suit was brought against the spy agency by privacy pressure groups.

The suit, brought against the GCHQ by UK-based NGO Privacy International, accuses GCHQ of infecting "potentially millions" of computers and smartphones around the world with malicious software, that could be used to do anything from extracting photos and text messages, switching on the phone's microphone or camera, or tracking locations or listening in to calls.

According to the top-secret documents, British spies use software called "Nosey Smurf" to secretly monitor devices' microphones and even record conversations.

Related: The year the NSA hacked the world: A 2013 PRISM timeline

Privacy International filed the case in order to demand "an end to the unlawful hacking being carried out by GCHQ which, in partnership with the NSA" has carried out some of the most extensive spying operations ever known to man.

The activities of the two spy agencies were brought to the attention of the world when whistleblower Edward Snowden leaked thousands of documents he stole from the American National Security Agency (NSA) after working for them as a contractor.

The case alleges that the preferred methods of data collection used by GCHQ violate articles 8 and 10 of the European Convention on Human Rights.

Article 8 defines the right of EU citizens to respect for private and family life, home and correspondence. It has been alleged that GCHQ has repeatedly broken this law by infecting people's smartphones with malware capable of spying on them.

Eric King, deputy director of Privacy International, said: "Unrestrained, unregulated Government spying of this kind is the antithesis of the rule of law and Government must be held accountable for their actions."

He added: "The hacking programmes being undertaken by GCHQ are the modern equivalent of the government entering your house, rummaging through your filing cabinets, diaries, journals and correspondence, before planting bugs in every room you enter."

Read more: How to tell if your Android phone is infected with malware