Image caption Critics say the new law is still authoritarian and does not take enough account of civil liberties

Malaysia has announced a new security law that will end the government's power to detain people indefinitely without trial.

The new bill, expected to be passed by parliament, limits the detention period to 28 days and offers more legal protection to those accused.

Prime Minister Najib Razak described it as a historic day for Malaysia.

But opposition groups say the new law is draconian and that the 28-day time limit is still unacceptable.

They have accused the government of using the old security act to stifle political debate and lock up critics.

Syed Ibrahim Syed Noh - a prominent critic of the new law - called for it to be abolished entirely without being replaced.

He said that there were no proper consultations with human rights groups before the draft law was tabled and that the 28-day limit was "excessive".

"It is still a form of detention without trial. It is unacceptable," he said.

But Mr Najib says that the move will give more freedom to Malaysians because people cannot be detained on the basis of their political ideology.

'Major step forward'

In a statement the prime minister said the new law was a "careful balancing act... to protect national security and combat terrorism at the same time as introducing new safeguards for civil liberties".

"This is a historic day for Malaysia and another major step forward on the road to reform," he said.

The new law is expected to be approved after a debate in parliament next week. The coalition led by Mr Najib commands a big majority in the assembly.

The new anti-terrorism bill will replace the Internal Security Act (ISA), which allows police to detain suspects indefinitely without trial, in a country long known for authoritarian rule. Opposition groups say that about 30 people are currently being held under the ISA.

The ISA was adapted from the British in 1960 during the communist insurgency and was later used to fight terrorism.

Human rights activists say the law has been used as a tool by the government to silence its critics.

The BBC's Jennifer Pak in Kuala Lumpur says the move is being seen as a bid to repair the prime minister's image ahead of a possible early election.

Our correspondent says that after five decades in power, his party has been accused of being out of touch with Malaysians.