Getty Images/iStockphoto

The High Court has granted Liberty permission to challenge part of the UK's "extreme mass surveillance regime", with a judicial review of the Investigatory Powers Act.

The law forces internet companies to keep logs of emails, phone calls, texts and web browsing histories and to hand them over to the state to be stored or examined. The civil liberties campaign group wants to challenge this mass collection, arguing that the measure breaches British people's rights.

In a separate case in December, the European Court of Justice ruled the same powers in the previous law governing UK state surveillance were unlawful.

The government argues that it needs access to the data to help with criminal investigations and that the legislation is required because so much communication is done online. But Liberty said the legislation had passed through Parliament in part thanks to "shambolic political opposition" and that the government failed to provide evidence that surveillance of everybody in the UK was lawful or necessary.

Martha Spurrier, director of Liberty, said: "It's become clearer than ever in recent months that this law is not fit for purpose. The government doesn't need to spy on the entire population to fight terrorism. All that does is undermine the very rights, freedoms and democracy terrorists seek to destroy."

She added: "Our government's obsession with storing vast amounts of sensitive information about every single one of us looks dangerously irresponsible. If they truly want to keep us safe and protect our cybersecurity, they urgently need to face up to reality and focus on closely monitoring those who pose a serious threat."

The High Court has also allowed Liberty to seek permission to challenge three other parts of the Act, either once the government publishes further codes of practice, or by March 2018.

These include bulk and 'thematic' hacking,which allows police and intelligence agencies to hack into devices on an industrial scale.

It also allows Liberty to challenge the bulk interception and acquisition of communications content and the use of bulk personal datasets, which allows government agencies to access vast databases held by the public or private sector, which Liberty said contain details on "religion, ethnic origin, sexuality, political leanings and health problems, potentially on the entire population - and are ripe for abuse and discrimination".

Liberty said that now permission has been granted, its application for a costs capping order will be considered. If this application is granted, the case will be listed for a full hearing.

Read more on web surveillance