The punishment of around 80 lashes was administered during the day in a park in the provincial capital Banda Aceh. Both were beaten with a rattan cane while people watched. In the pictures, one of the men can be seen hanging limp against a policeman after the flogging.
The men, 18 and 24 years old, are students at the same university. They were arrested in November and accused of same-sex relations, which violate the province's strict Sharia laws.
Human rights organizations condemn the region of Aceh's treatment of LGBTQ people.
The threats, discrimination, and violence against LGBTQ people in Aceh are like a bottomless pit, says Human Rights Watch's Andreas Harsono to AFP.
Aceh, located on the northern tip of the island of Sumatra, is the only Indonesian province governed by Sharia law.