SINGAPORE (Reuters) - A Singapore court jailed four Bangladeshi men for between two and five years for terrorism financing on Tuesday in a case that has put the city-state's most marginalized migrant-worker community in the spotlight.

Authorities said the men contributed from S$60 ($45) to S$1,360 ($1,000) to fund attacks in their homeland in the name of Islamic State in Bangladesh. It was Singapore's first case of terrorism financing.

"The amounts were significant relative to the salaries of the accused persons," said the prosecutor, who did not give his name for security reasons.

The sentences would send a "strong message that every and all terrorism financing will be dealt with", he said.

The four were among eight Bangladeshi men detained under the Internal Security Act in April for planning attacks in their home country. The colonial-era law allows suspects to be held for lengthy periods without trial.

The group's leader, Rahman Mizanur, 31, a draftsman earning S$1,800 ($1,300) a month, was jailed for five years.

"I wanted to learn my religion but they show me the wrong way, the wrong activities," Mizanur said in court. "My intentions were wrong ... I'm very remorseful."

Two others were jailed for two and a half years and the fourth for two years.

Bangladesh, a deeply religious but mostly moderate Muslim-majority country of 160 million people, has faced a series of militant attacks over the past year, the most serious on July 1 when gunmen stormed a cafe in the capital, Dhaka, and killed 20 people, most of them foreigners.

Wealthy, multi-ethnic Singapore, has not faced any successful militant attacks in decades. There were no indications the men had planned to carry out attacks in Singapore.

Most Bangladeshis in Singapore are low-skilled and employed in construction and shipping.

Of the other four Bangladeshis detained in April, two who have yet to face trial pleaded not guilty when charged, saying they were unaware where their money was going.

The remaining two have yet to be charged and remain in detention. No other details have been given.

Singapore authorities said the eight men, aged 26-34, plotted attacks in parks where they shared radical propaganda and videos.

Five other Bangladeshis who came to the attention of authorities attention during the investigation were sent home in April and arrested upon their return. Bangladesh police said they were being investigated for connections to the Ansarullah Bangla Team militant group.

Islamic State claimed the July 1 cafe attack in Dhaka but the government said domestic militants were responsible.