The House of Lords has passed the Investigatory Powers Bill, putting the huge spying powers on their way to becoming law within weeks. The bill – which forces internet companies to keep records on their users for up to a year, and allows the Government to force companies to hack into or break things they’ve sold so they can be spied on – has been fought against by privacy campaigners and technology companies including Apple and Twitter.

But the Government has worked to continue to pass the bill, despite objections from those companies that the legislation is not possible to enforce and would make customers unsafe. The House of Lords’s agreement to the text now means that it just awaits Royal Assent, at which point it will become law.

Gadget and tech news: In pictures Show all 25 1 /25 Gadget and tech news: In pictures Gadget and tech news: In pictures Gun-toting humanoid robot sent into space Russia has launched a humanoid robot into space on a rocket bound for the International Space Station (ISS). The robot Fedor will spend 10 days aboard the ISS practising skills such as using tools to fix issues onboard. Russia's deputy prime minister Dmitry Rogozin has previously shared videos of Fedor handling and shooting guns at a firing range with deadly accuracy. Dmitry Rogozin/Twitter Gadget and tech news: In pictures Google turns 21 Google celebrates its 21st birthday on September 27. The The search engine was founded in September 1998 by two PhD students, Larry Page and Sergey Brin, in their dormitories at California’s Stanford University. Page and Brin chose the name google as it recalled the mathematic term 'googol', meaning 10 raised to the power of 100 Google Gadget and tech news: In pictures Hexa drone lifts off Chief engineer of LIFT aircraft Balazs Kerulo demonstrates the company's "Hexa" personal drone craft in Lago Vista, Texas on June 3 2019 Reuters Gadget and tech news: In pictures Project Scarlett to succeed Xbox One Microsoft announced Project Scarlett, the successor to the Xbox One, at E3 2019. The company said that the new console will be 4 times as powerful as the Xbox One and is slated for a release date of Christmas 2020 Getty Gadget and tech news: In pictures First new iPod in four years Apple has announced the new iPod Touch, the first new iPod in four years. The device will have the option of adding more storage, up to 256GB Apple Gadget and tech news: In pictures Folding phone may flop Samsung will cancel orders of its Galaxy Fold phone at the end of May if the phone is not then ready for sale. The $2000 folding phone has been found to break easily with review copies being recalled after backlash PA Gadget and tech news: In pictures Charging mat non-starter Apple has cancelled its AirPower wireless charging mat, which was slated as a way to charge numerous apple products at once AFP/Getty Gadget and tech news: In pictures "Super league" India shoots down satellite India has claimed status as part of a "super league" of nations after shooting down a live satellite in a test of new missile technology EPA Gadget and tech news: In pictures 5G incoming 5G wireless internet is expected to launch in 2019, with the potential to reach speeds of 50mb/s Getty Gadget and tech news: In pictures Uber halts driverless testing after death Uber has halted testing of driverless vehicles after a woman was killed by one of their cars in Tempe, Arizona. March 19 2018 Getty Gadget and tech news: In pictures A humanoid robot gestures during a demo at a stall in the Indian Machine Tools Expo, IMTEX/Tooltech 2017 held in Bangalore Getty Gadget and tech news: In pictures A humanoid robot gestures during a demo at a stall in the Indian Machine Tools Expo, IMTEX/Tooltech 2017 held in Bangalore Getty Gadget and tech news: In pictures Engineers test a four-metre-tall humanoid manned robot dubbed Method-2 in a lab of the Hankook Mirae Technology in Gunpo, south of Seoul, South Korea Jung Yeon-Je/AFP/Getty Gadget and tech news: In pictures Engineers test a four-metre-tall humanoid manned robot dubbed Method-2 in a lab of the Hankook Mirae Technology in Gunpo, south of Seoul, South Korea Jung Yeon-Je/AFP/Getty Gadget and tech news: In pictures The giant human-like robot bears a striking resemblance to the military robots starring in the movie 'Avatar' and is claimed as a world first by its creators from a South Korean robotic company Jung Yeon-Je/AFP/Getty Gadget and tech news: In pictures Engineers test a four-metre-tall humanoid manned robot dubbed Method-2 in a lab of the Hankook Mirae Technology in Gunpo, south of Seoul, South Korea Jung Yeon-Je/AFP/Getty Gadget and tech news: In pictures Waseda University's saxophonist robot WAS-5, developed by professor Atsuo Takanishi Rex Gadget and tech news: In pictures Waseda University's saxophonist robot WAS-5, developed by professor Atsuo Takanishi and Kaptain Rock playing one string light saber guitar perform jam session Rex Gadget and tech news: In pictures A test line of a new energy suspension railway resembling the giant panda is seen in Chengdu, Sichuan Province, China Reuters Gadget and tech news: In pictures A test line of a new energy suspension railway, resembling a giant panda, is seen in Chengdu, Sichuan Province, China Reuters Gadget and tech news: In pictures A concept car by Trumpchi from GAC Group is shown at the International Automobile Exhibition in Guangzhou, China Rex Gadget and tech news: In pictures A Mirai fuel cell vehicle by Toyota is displayed at the International Automobile Exhibition in Guangzhou, China Reuters Gadget and tech news: In pictures A visitor tries a Nissan VR experience at the International Automobile Exhibition in Guangzhou, China Reuters Gadget and tech news: In pictures A man looks at an exhibit entitled 'Mimus' a giant industrial robot which has been reprogrammed to interact with humans during a photocall at the new Design Museum in South Kensington, London Getty Gadget and tech news: In pictures A new Israeli Da-Vinci unmanned aerial vehicle manufactured by Elbit Systems is displayed during the 4th International conference on Home Land Security and Cyber in the Israeli coastal city of Tel Aviv Getty

Those opposing the bill argue that it has been hastily written and is being pushed through parliament too quickly to ensure that it doesn't receive full scrutiny. That has led to the bill including measures that are still undefined and so could be used by the government to force companies to do almost anything, tech firms have argued.

The main objections to the bill centre around the vast new powers that the government is given to spy on its citizens. It includes powers to force companies to make their phones less secure so that they can be listened in on by spies, and others that would allow the government to ask companies like Apple and Google to help them break or hack into phones.

Perhaps the most controversial measure will require internet service providers to keep detailed information on their customers’ web browsing for the last year. There will be no way of opting out of that and the data will be collected on everyone, leading to fears that it could be stolen and leaked, especially given the huge scale of the Talk Talk hack earlier this year.

In all, the new bill includes a range of changes to the law that will affect normal people, and gives Britain perhaps the most extreme spying powers in the developed world.

The apparently final part of the Government’s fight to have the powers passed came as it refused to budge over its proposed new surveillance powers by rejecting for a second time amendments from peers linked to phone hacking.

Solicitor General Robert Buckland insisted it would be “simply not appropriate” to include within the Investigatory Powers Bill changes designed to ensure costs are awarded against newspaper and media organisations in phone hacking cases.

Peers have repeatedly sought to amend the Bill so it implements a key part of the Leveson Inquiry report by offering “protection” over costs for victims of press intrusion.

But MPs voted to reject the latest Lords amendments by 295 votes to 245, majority 50.

A parliamentary process known as ping-pong is ongoing, which sees the Bill move between the Commons and the Lords until a final decision is taken over the text.

It will return to the Lords for further scrutiny.

The Bill gives a range of new powers to access data and internet communications to police and security services.

Elsewhere, ministers are also conducting a 10-week consultation which includes examining whether to implement legislation which would force newspapers to pay all of the costs of libel or privacy actions brought against them – even if they win their case.

This would not apply to publications which sign up to a new state-backed press regulator.

Mr Buckland reiterated this consultation “speaks directly to the concerns” of those who support the Lords amendments.

He recognised independent crossbencher Baroness Hollins had revised her amendments, but later told MPs: “They have no place in a Bill that relates to the regulation of investigative powers.

“This is all about national security, this is about dealing with crime whether it's child abuse, whether it’s trafficking, whether it's drug dealing, whether it’s the sort of criminality that we want to deal with in our society.

“That’s why these amendments are not only out of place but also they pre-empt the outcome of the consultation launched by (Culture Secretary Karen Bradley).”

Tory MP Jacob Rees-Mogg (North East Somerset), intervening, said: “Wouldn’t you go further and to say that putting restrictions on the press in a Bill on national security is actually precisely the wrong place to have restrictions on the press - it makes it look as if we're really trying to hit them hard?”

Mr Buckland noted an “important point” had been made.

Shadow home secretary Diane Abbott backed the changes proposed by peers, telling the Commons: “I believe any member of the public who just heard the speech from the Government benches will be puzzled as to the Government's continuing resistance to implementing an aspect of Leveson that it, in principle, agreed to some time ago.

“Labour fully supports this set of amendments to the Investigatory Powers Bill and on this side of the House we have consistently and genuinely called for the Leveson recommendations to be implemented in full.”

SNP justice spokeswoman Joanna Cherry also supported the amendments and said: “Those who have not hacked, do not hack phones and do not intend to hack telephones or indeed emails have nothing to fear from these provisions.”

But Mr Rees-Mogg said: “This is an absolutely dreadful amendment. It should be thrown out, rejected, sent back to the House of Lords.

“It is fundamentally wrong. It seeks to punish those who may be innocent, to fine them for telling the truth, for saying things that people in power do not like.

“It goes to the heart of our free press and it should be thrown in the bin.”