Malaysia's security minister has called for police to "shoot first" when they encounter criminals and defended a spate of killings by police.

The opposition has branded remarks by Ahmad Zahid Hamidi, the minister for internal security, as giving police a licence to kill to deal with a recent upsurge in gang-related violence in the generally peaceful nation.

Zahid said there is no longer a need to comprise with suspects.

"There is no need to give any more warning shots. If we get the evidence we shoot first," he said, referring to 40,000 alleged gang members, half of whom he claimed were ethnic-Indian Malaysians.

Opposition MP N Surendran, a member of opposition leader Anwar Ibrahim's Keadilan party, said Zahid's admission would shock the nation.

"It is nothing short of ministerial endorsement of extrajudicial killings by the police," he told the AFP news agency.

"It is incitement and approval of cold-blooded murder by the police force."

Zahid's comments come only days after parliament passed a law allowing detention without trial which human-rights groups say amounts to reintroducing the practice that was scrapped under a draconian Internal Security Act in 2011.

The Malaysiakini news website has published Zahid's remarks after obtaining a 20-minute audio recording of his speech at a gathering of community leaders last weekend.

Zahid had threatened to close any newspaper that published what he had said.

Referring to an amendment to the Prevention of Crime Act 1959, which reintroduces detention without trial, Zahid said: "We investigate [criminal cases], we take it to the courts. If there is no evidence, at least there are still two years [detention]. That is my new law, there is no compromise."

Shortly before the law was passed Prime Minister Najib Razak denied it marked a return to the dark days of the ISA.

"If the police arrest anyone, they will have to convince the judge that the particular individual should be detained," Mr Najib said at the time. "And we will make sure no one is victimised."

At least 10 criminal suspects have been killed in police shootouts in recent weeks, including five alleged gang members on the island of Penang in August.

There has also been a surge in execution-style killings involving firearms, including that of a former banker and senior civil servant.