EU Data Retention Directive was introduced into Swedish law on 1 May 2012 and the Swedish Post and Telecom Agency, or PTS, was ordered to ensure compliance.
The rule meant that mobile and broadband companies were obliged to retain traffic data about data and telephone records for six months, even when it involves a person calling another without getting an answer.
Details of where people were when a call was initiated was stored, as well as where they were when the call or the communication ended.
The law, which had been criticized for being too broad, was used by police authorities to require operators to deliver data, according to the Swedish daily newspaper Dagens Nyheter.
PTS lawyer Staffan Lindmark had not yet read the decision closely, and did not want to say if the decision would have much practical effect in Sweden, where the regulation was written into the law books several years ago.
"It's really too early to say whether the Swedish national rules could still be applied," Lindmark told Radio Sweden, "There are some elements of the Swedish law that are different from the directive. We have strict rules on when the operators are allowed to give the data to the law enforcement authorities, which is not something that is part of the directive," he added.
European Union Commissioner Cecilia Malmström does not believe the directive is likely to be replaced or reintroduced, according to DN.