Malaysia's leader has defended strict security laws to fight terrorism as the Islamic State group warned of revenge over a crackdown on its members.

Prime Minister Najib Razak says the terrorism threat is "very real" and that the laws are crucial to ensure Malaysia is not open to infiltration.

Opening a two-day counter-terrorism conference, Najib said Monday that "the best way to uphold civil liberties is to ensure the safety of the nation."

Human rights activists have slammed a law implemented last year that revives detention without trial, and another law approved last month that gives sweeping powers to a council led by the prime minister.

Police earlier said the Islamic State group had posted a video that warns of attacks over the arrest of its members.