The revised Computer Misuse Act passed on Monday gives authorities sweeping powers to police the internet.
Ho Peng Kee, Senior Minister of State for Law and Home Affairs, said the law aimed at fighting "cyber-terrorism" would be used sparingly, chiefly against threats to national security, essential services such as banking and finance and foreign relations.
The bill allows police to take pre-emptive action based on credible information even before the hackers have struck.
People who hack or deface a web site may be jailed for up to three years or fined up to $5800.
But critics of the stiff cyber-law said it reminded of Singapore's draconian Internal Security Act that allows detention without trial.
"Indeed it sounds very much like the cyber-space equivalent of the Internal Security Act," said Ho Geok Choo, a member of parliament.
"How does the police cyber-crime unit intend to differentiate between a real intent to compromise our national computer networks from those that are merely wild talk," she asked.
The authorities, however, insist the law was needed, particularly since instances of computer hackings have been on the rise.
There have been 41 successful hackings in Singapore last year, compared to just 10 in 2000 and 19 in 2001.