The vote, which took place on Wednesday, June 18, proved to be one of the most divisive in Sweden in recent years.
Critics slammed the bill as an attack on civil liberties in a country that prides itself on its liberal attitudes.
Initially scheduled for early Wednesday, it was delayed after more than one-third of MPs voted to send the bill back to parliament's defense committee for review.
At stake was Sweden's center-right government’s attempt to introduce a wide-ranging surveillance law which would have allowed all cross-border Internet and telephone traffic to be monitored.
The government cited the changing nature of security threats, terrorism, international crime and the specter of cyber warfare to push through the law which hands intelligence agencies far-ranging powers to snoop on citizens' personal data.
The Swedish journalists' union said the bill constituted the "final nail in the coffin of democracy."
Swedish Prime Minister Fredrik Reinfeldt first failed to get the backing of its own four-party coalition in his push for wide-ranging monitoring of cross-border Internet data and taps on international telephone calls to discover what he ahs called "dangers from abroad" more quickly,
But after the committee required that the center-right government safeguard individual rights further in an annex to the law to be voted on in the autumn, the bill narrowly passed with 143 votes in favor, 138 opposed and one parliamentarian abstaining.
The government holds a seven-seat majority in parliament, so with the left-wing opposition vehemently opposed to the proposal, it would have taken just four "no" votes within the coalition to have spiked it.
Bringing systems into line
The new law, set to take effect on Jan. 1, 2009, will enable the military National Defense Radio Establishment (FRA) to monitor Swedes' Internet usage as well as content from e-mails, phone calls and text messages.
The legislation requires all telecom operators in Sweden to bring their systems into line with FRA's surveillance system.
But although the government said only cross-border communications would be monitored, all communications risk getting caught in the net since some internet servers are located abroad and FRA would need to check all emails to determine whether they have crossed the border.
Under the current law, FRA is only allowed to monitor military radio communications.
The Defense Ministry maintains the new legislation is necessary in today's changed world, where communications are increasingly transmitted through fibre-optic cables.
Before Wednesday's revisions, many coalition members voiced deep concern about the bill,. Other critics included human rights activists, journalists, lawyers and even the former head of the Swedish intelligence agency Saepo, who had argued that it did not go far enough in safeguarding individual rights.
Unlike police, FRA will, for instance, not be required to seek a court order to begin surveillance.
But on Wednesday, the government insisted it had addressed these concerns with the last-minute revisions to the law that among other things added further independent and parliamentary controls to FRA's work.
Former Saepo chief Anders Eriksson, who currently heads up the Swedish Commission on Security and Integrity Protection, was skeptical.
"I think the law needs to be re-written," he told Swedish radio before the vote. "It is not enough to create a few checks and balances ... It is the law itself there is something wrong with."