In submissions to the hearing, it emerged that in 2013 around 20 per cent of GCHQ’s intelligence reports contained information derived from hacking.

The tactic, also known as computer network exploitation, allows authorities to interfere with electronic devices such as smartphones, tablets and PCs in order to obtain data.

Operations can range from using a target's login credentials to gain access to information held on a computer to more sophisticated tactics such as remotely installing a piece of software in order to obtain the desired intelligence and covertly downloading the contents of a mobile phone.

The methods are seen as an increasingly crucial tool as advanced encryption makes it more difficult for security services to keep track of terrorists.

Hacking is a vital part of GCHQ work, the tribunal heard Photo: Alamy

The challenge was brought by Privacy International and seven Internet service providers.

But in its judgment the tribunal concluded that the legal regime under which warrants are issued for the agency to carry out equipment interference in the UK is compatible with European Convention on Human Rights articles.

The framework was also found to be compliant prior to the publication of a code of practice on the tactics in February last year.

Foreign Secretary Philip Hammond welcomed the ruling "and its judgment that a proper balance is being struck between the need to keep Britain safe and the protection of individuals' privacy".

He added: "The ability to exploit computer networks plays a crucial part in our ability to protect the British public.

"Once again, the law and practice around our security and intelligence agencies' capabilities and procedures have been scrutinised by an independent body and been confirmed to be lawful and proportionate."

Bella Sankey, of campaign group Liberty, said: "These 'nothing to see here' rulings have become depressingly predictable.

"While the Government's surveillance law and policy gets shredded by experts, parliamentarians and rights campaigners, the tribunal's loyal rulings are becoming a bad joke.