Malaysian counter-terrorism officers have foiled a plot to attack "vice areas" in Melaka with smoke bombs and arrested five men, including a foreigner.

The five were among 10 suspected militants nabbed in a series of swoops across seven states last month, national police chief Mohamad Fuzi Harun disclosed in a statement yesterday.

He said the suspects, aged between 18 and 53, were detained between Aug 11 and 31 in Selangor, Pahang, Johor, Terengganu, Kelantan, Melaka and Penang.

"The men were members of two separate terror cells that had planned to collaborate with a Middle Eastern group," Tan Sri Fuzi said.

The five men who were planning the smoke bomb attacks were arrested in Kelantan, Melaka and Penang between Aug 25 and 31.

"The group was known as Ar Rayah. They are aged between 18 and 50. The main suspect from the cell had plans to launch smoke bomb attacks in vice areas in Melaka," Mr Fuzi said.

Police have seized five smoke bombs, he said, adding that the attacks were intended to cause panic and chaos among patrons of the entertainment outlets and to hurt them. The main suspect in connection with the Ar Rayah cell was arrested on Aug 25, and the remaining four were taken into custody in Kelantan and Penang on Malaysia's National Day on Aug 31.

One of the suspects was a 50-year-old foreigner who worked at a restaurant.

He was part of a terror group in a South-east Asian country which promoted its "struggles and ideology" to Ar Rayah members via WhatsApp, the police chief said. He did not identify the South-east Asian country.

Related Story Malaysia detains 7 militants planning to kidnap, kill cops

Related Story Malaysia police hunt for four ISIS militants still on the run

Related Story Malaysian police arrest seven suspected ISIS militants

Related Story Malaysia police nab 11 suspected militants, including seven Filipinos

The foreign suspect also allegedly played a role in influencing Ar Rayah members to donate money for the purchase of weapons.

Mr Fuzi said that the five other suspects were members of another cell known as Asoib (Youths) from the East. Aged between 39 and 53, they were detained in Selangor, Pahang, Johor and Terengganu.

"They were planning to work with a foreign terror group from a Middle Eastern country to launch attacks in a bordering nation," he said.

An intelligence source here identified the two countries as Yemen and Saudi Arabia.

The police chief said the plan was for the cell to be supplied with various weapons by the Middle Eastern group.

A cell member, a 51-year-old from Kota Baru, in Kelantan, had left for the Middle Eastern country to make preparations and coordinate the planned attack.

The police chief said members of the terror cell have misinterpreted a hadith (sayings of the Prophet Muhammad) about Imam Mahdi, the prophesied redeemer in Islam.

"They believe that Imam Mahdi will appear in Mecca this year. This group will then collaborate with Imam Mahdi's 'army' to attack secular countries and fight against Dajjal (Deceiver)," he said.

Since 2013, Malaysia has arrested 420 people for suspected links to terrorism.