Britain said on Thursday it would rush through emergency legislation to force telecoms firms to retain customer data for a year, calling the move vital for national security following a decision by Europe's top court.

Communication companies had been required to retain data for 12 months under a 2006 European Union directive, but this was thrown out in April by the European Court of Justice on the grounds that it infringed on human rights.

Britain's coalition government said the scrapping of that directive could deprive police and intelligence agencies of access to information about who customers contacted by phone, text or email, and where and when.