The retained information is supposed to help police fight crime, but as parliamentarians convened there were many objections to the proposal.
"We didn't see any need for the EU to decide what kind of informaton national police should have access to, " said Ulrika Karlsson, Moderate party member.
Karlsson said it was former Social Democrat Justice Minister Tomas Bodström who had committed Sweden to the EU directive, which has caused much debate here.
Social Democrat Elin Lundgren defended the rules.
"When crime happens on the street we have police on the street. When crime happens, or is planned, on the internet, well then we need to have the tools to combat it," she told parliament.
Jens Holm, of the minority Left Party, did not agree.
"Maybe Lundgren and the government should argue that we all need to have a micro chip implanted in the back of our necks, so the state can monitor every step we take. That surely is the easiest way to hunt down criminals," he said.
Maria Ferm of the Green Party was also critical.
"When we build up such big systems that allow access to an incredible amount of private information about Swedish citizens, what happens if the system is abused?" she asked.
"Either information is leaked or maybe in the future a political party takes power who wants to use it for other ends," she said.
The Green and Left Parties, as well as individuals in the other parties, voted against introducing the law. It will come into effect on May 1 and is meant to only be used in criminal investigations.