The government is reviewing laws that allow for indefinite detention without trial and will provide details later, he said.
Syed Hamid Albar, the home minister, told the Reuters news agency that two of the men freed were from a group fighting for equal rights for ethnic Indians while the rest were from a terrorism-linked group.
Recent moves by the government to stifle dissent, including sedition charges against an opposition MP and a popular blogger, had fanned fears of a crackdown.
Najib, who took over from Abdullah Ahmad Badawi, has taken the top job at a time when the mostly Muslim country of 27 million people is expected to slip into its first recession in a decade.
He had been groomed for the premiership for over three decades but his reputation recently took a hit amid allegations linking him to the murder of a Mongolian model. He has denied the claims against him.
Najib appealed to minority ethnic groups in his address, broadcast live on state television.
"We must reach out to all parts of Malaysia ... to all our diverse communities," he said. "In our national discourse and in pursuing our national agenda, we must never leave anyone behind."
Najib earlier took the oath of office before the king in a traditional ceremony at the yellow-domed national palace in the capital Kuala Lumpur.
Malaysian prime ministers are officially appointed by the king, a constitutional monarch.