Image copyright AP Image caption Yang Kaiheng (right) was the "brainchild" behind the website. the judge ruled

A court in Singapore has sentenced a man to eight months in jail for publishing anti-foreigner material on his website.

Yang Kaiheng, 27, pleaded guilty to sedition and sowing discord between locals and foreigners.

Prosecutors said he had made up stories "designed to provoke hatred against foreigners in Singapore".

The judge said the website, The Real Singapore, ran controversial content purely to generate advertising revenue.

He said nationalist sentiment can have unpredictable consequences, as Britain's vote to leave the EU had shown.

"At the heart of this case against the accused lies the exploitation of such feelings purely for financial gain and not for some noble ideology, misguided or otherwise."

Yang ran the website with his Australian wife Ai Takagi.

The website had nearly 13 million views a month and earned the couple hundreds of thousands of dollars in advertising revenue, prosecutors said.

Wife jailed

Prosecutors said the articles were mostly intended to stir up hatred against Indian, Chinese and Filipino immigrants.

One article falsely reported that a Chinese boy had urinated in a bottle on the metro, while another accused a a Filipino family of starting scuffles at a Hindu festival in 2015, AFP news agency reports.

Singapore's sedition act bans behaviour that promotes racial hatred. Critics say it is also used to curb free speech.

About 40% of the city state's 5.5 million population is foreign.

Takagi was found guilty on similar charges in April and is serving a 10-month sentence after admitting editing the site and using a false male identity to post fictitious articles.

Although she was found to have written the articles, the judge said the website was the brainchild of Yang and that he had been in full control of it and its published content.