The two men were flogged more than 80 times each for having gay sex, which is outlawed under local Islamic law, as a jeering crowd hurled abuse at them.
They were among 15 people whipped outside a mosque in the provincial capital Banda Aceh on Friday for crimes also including drinking or selling alcohol and showing affection in public.
A crowd of about 1,000 people, including tourists from neighbouring Malaysia, snapped pictures and shouted "Flog them harder" as a hooded figure rained down lashes from a rattan cane on their backs.
Anti-gay hostility threatens Indonesia's AIDS battle: activists
The unidentified men were the second gay couple whipped in public this year in Aceh, as the small LBGT community in Indonesia faces increasing discrimination.
Aceh is the only region in Indonesia, the world's most populous Muslim-majority country, that imposes Islamic law.
Public flogging is a common punishment for a range of offences including gambling, drinking alcohol, and having gay sex or relations outside of marriage.
Aceh, on the northern tip of Sumatra island, said this year it would stop public whippings but continue the punishment behind prison walls.
The new policy has not yet been implemented.
Rights groups slam public caning as cruel and Indonesia's President Joko Widodo has called for an end to it.
Living a double life: Indonesia's atheists fear jail or worse
But the practice has wide support among Aceh's mostly Muslim population, including provincial governor Irwandi Yusuf, who himself was arrested last week on corruption charges.
The gay men whipped on Friday were apprehended by a vigilante mob at a Banda Aceh beauty salon earlier this year and handed over to police, authorities said.
Gay sex is not illegal elsewhere in Indonesia, but there has been a backlash against the community across the archipelago in recent years as same-sex marriage has been legalised in other countries.
Aceh started using religious law after it was granted special autonomy in 2001, an attempt by the central government to quell a long-running separatist insurgency.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ