Malaysian legislators have approved a law designed to prevent authorities from detaining suspects indefinitely without trial.

The Security Offenses Bill is the centerpiece of Prime Minister Najib Razak's pledge to reform decades-old laws that opposition and rights groups consider repressive.

Rights activists nevertheless say the proposed law remains vulnerable to abuse. Opposition leaders insist it's a government ploy to introduce superficial changes ahead of national elections expected within months.

Parliament's lower house on Tuesday passed the bill that limits detentions without charge to 28 days.

The bill requires the formalities of being endorsed by Parliament's upper house and Malaysia's constitutional monarch before it comes into force.