AN Indonesian civil servant who declared himself an atheist on Facebook was arrested and is now facing jail for blasphemy after being attacked by an angry mob, police said today.

Alexander An, 30, who wrote "God doesn't exist" on his Facebook page, was beaten by a mob of dozens on Wednesday in his hometown in Pulau Punjung, West Sumatra province.

"He is suspected of having blasphemed against Islam," local police chief Chairul Aziz told AFP.

"The man told police investigators that if God really exists and has absolute power, why didn't he prevent bad things from happening in this world."

An said on his Facebook page that he was brought up as a Muslim, like the vast majority in Indonesia, where blasphemy is a punishable crime carrying a maximum five-year prison term.

Dozens of locals stormed into his office after a heated debate with them on Facebook over religion, police said.

An was also an administrator of a Facebook group promoting atheism with 1243 followers. His postings no longer appeared online following his arrest.