This is the moment two gay men grimaced in agony as they were brutally whipped in public over their same-sex relations in Aceh, Indonesia.

They were flogged 76 times each in the conservative province after they were found guilty of sexual relations by a court operating under strict Islamic law.

Gay sex is outlawed in Aceh, which imposes a version of sharia, the Islamic legal code, but it is not illegal elsewhere in the world's most populous Muslim majority country.

The men were part of a group of 10 who were flogged on Tuesday at a park in the provincial capital for a range of alleged crimes.

The pair were flogged separately with a rattan stick as a small crowd watched, according to an AFP journalist present.