Members of the public requested a block on pornographic internet sites
Indonesia's parliament has passed a bill criminalising those who access internet sites containing violent or pornographic material.
Anyone found guilty of the new offence could be jailed for up to three years, or have to pay a heavy fine.
The legislation allows the courts to accept electronic material as evidence in cases involving internet abuse.
One of those involved in drafting the bill said children, in particular, needed protection from online images.
It passed with wide majority support from all 10 factions in the chamber.
"I think we all agree there's no way we can save this nation by spreading pornography, violence and ethnic hostility", said the Information Minister, Mohammad Nuh.
Another MP said that current legislation failed properly to address pornography in the electronic media, and that access to it was far too easy.
The intention is to start implementing restrictions on sites containing banned material next month, using special software.
There was an outcry from hardline Muslim groups two years ago when Playboy magazine began publishing in Indonesia. The protest forced the magazine's editorial team to move their office to Bali.
A court later cleared the magazine's editor of distributing indecent pictures to the public and making money from them.
The BBC's Lucy Williamson in Jakarta says that stronger pornographic material continues to be widely available in Indonesia.
This has prompted a vigorous debate in recent years, exposing deep divisions in a country where 85% of the population follows Islam.