ISIS flag Syria
ISIS militants killed Iranian military's senior commander Gen. Hossein Hamedani, Iran's state media reported Friday. An Islamic State group flag flies in the northern Syrian town of Tel Abyad as it is pictured from the Turkish border town of Akcakale, in Sanliurfa province, Turkey, on June 15, 2015. Getty Images/Gokhan Sahin

Two "self-radicalized" Singaporeans were detained in August under the country's Internal Security Act (ISA) for planning to join the Islamic State group in Iraq and Syria, Singapore's ministry of home affairs said in a statement Wednesday.

The two men, identified as Muhammad Shamin bin Mohamed Sidek, 29, and Muhammad Harith Jailani, 18, were detained in two separate cases, authorities said, adding that they were radicalized by ISIS' online propaganda.

Shamin had been convicted and sentenced to three months in jail in May for inciting religious violence through his pro-ISIS posts on social media, the ministry said. "As he continued to express unstinting support for ISIS throughout his three-month imprisonment, he was arrested under the ISA in July 2015 for investigations to assess if he posed a threat to Singapore's security," the ministry said, in the statement, adding that further investigation showed that Shamin planned to travel to Syria to join ISIS “once he had raised enough money to fund the trip.”

According to the ministry, Shamin “was prepared to die in the course of defending the 'caliphate' that was declared by ISIS.”

The ministry said that Harith was also radicalized by ISIS propaganda on the Internet.

"He was prepared to be trained by ISIS to fight and kill the group's enemies, and to die in the process so that he would receive divine rewards for dying as a martyr,” the ministry said in the statement.

According to the authorities, Harith had collected information on how to travel to Syria and also made several attempts to recruit those around him to join the Sunni militant group’s war against the West.

"The detentions of Shamin and Harith underline the persistent ISIS threat and the threat posed by self-radicalized Singaporeans," the home affairs ministry said. "A few of the Singaporeans who have been detained had even been prepared to carry out terrorist attacks in Singapore."

In June, Singapore arrested a “self-radicalized” man who tried to join ISIS. The man -- identified as 51-year-old Mustafa bin Sultan Ali -- was arrested after being deported from Turkey, from where he planned to further join the ISIS in Syria.

In May, a 19-year-old Singaporean, identified as Arifil Azim Putra Norja'i, was detained for working with ISIS and planning to conduct attacks against civilians in Singapore. A 17-year-old was also arrested by Singaporean authorities the same month.