A Swiss man has been sentenced to one year in prison on the Indonesian island of Bali after he made derogatory online remarks about an important Hindu holiday.

A judge in the city of Denpasar found the 26-year-old guilty of making offensive remarks on social media about the Nyepi holiday, also known as the Day of Silence, local media reported on Friday.

Bali is the only island in Indonesia - the world's largest Muslim country - with a Hindu majority. Faith is deeply rooted in everyday life.

On the Day of Silence, local security forces monitor compliance with regulations. Visitors are expected to behave calmly and respectfully - though tourists are usually allowed to move about freely within their hotel complexes.

No one is allowed on the streets, traffic comes to a complete standstill, and even Ngurah Rai International Airport remains closed.

According to the public prosecutor's office, the 26-year-old Swiss man was informed of the holiday's rules by hotel staff upon his arrival in Bali last February. When he got hungry and was not allowed to leave the hotel, he reportedly flew into a rage.

The Swiss national then recorded a video outside the hotel and posted it on his Instagram Story. According to a translation, the post contained the words: "Fuck Nyepi Day and fuck your rules too."

The video spread rapidly and caused widespread outrage. The man was arrested in March.

The five months he has spent in pre-trial detention since then will be deducted from the one-year prison sentence.