The Diet enacted a revised law Tuesday to tackle online stalking in response to an increase in harassment cases involving social media.

The revised law will cover a wide range of stalking acts such as repeatedly sending messages on social networking services and persistent postings on an individual blog.

It will also strengthen penalties for stalking, raising the prison term to up to a year from up to six months under the current legislation, while making it possible for public prosecutors to indict suspects without victims' accusations.

Under the revised law, authorities will in some cases be able to order suspected stalkers to avoid contact with victims without first issuing a warning, as is currently required.

However, some experts have expressed concern about the increased powers given to law enforcement authorities.

The revision comes after a high-profile case in which an aspiring pop idol was nearly stabbed to death by a man who claimed to be her fan.

Mayu Tomita, 21, who performed at events around the metropolitan area, was attacked in May in Koganei, western Tokyo, after repeatedly notifying police of ongoing online harassment by the assailant.

The case also raised public awareness about the limitations of existing laws in combating online stalking.

The latest revision is the second for the anti-stalking law, enacted in 2000, following the first in 2013, when harassment by email became subject to regulation.