The crowd roared as two men in their early 20s, one muttering through clenched teeth received 83 lashes each outside a mosque in the Indonesian province of Aceh for the crime of gay sex.
One of the men, who was just 20, was given a glass of water after the 40th lash. A doctor approached him after the 60th and asked him if he was still strong. He nodded.
Two men receive 83 lashes for gay sex in the first conviction for homosexuality in Indonesia's conservative Aceh province.
Three hooded men took turns to flog the pair.
The audience, estimated by police to be 2500 people, gathered before the red-carpeted platform in front of Syuhada mosque in Banda Aceh, the provincial capital, baying in frustration when the caning paused.
This was the first time sharia courts had imposed public flogging for sodomy under new laws introduced in 2014 as part of Aceh's Islamic criminal code, known as Qanun Jinayat.
The law criminalises liwath, or sodomy, with a maximum punishment of 100 lashes, 100 months in jail or a fine of 1000 grams of gold.
Four heterosexual couples also received up to 30 lashes of the cane for khalwat (being in close proximity, such as secluded in a room, when not married), which is effectively kissing and hugging.
One of the women couldn't continue after nine lashes and had a break before returning to the platform, where a white triangle marked where the convicted must stand and face the crowd while being caned.
"You are strong in bed, but you pretend to be in pain when caned," someone yelled.
A medical team, including an ambulance, were on standby. Under regulations, those being punished must be caned from the waist up.
Men and women were separated to observe the caning, with an announcer warning the crowd that children should not be present.
But the mothers can then tell them at home as education on the enforcing of sharia law, he said.
Aceh is the only one of Muslim-majority Indonesia's 34 provinces that criminalises homosexuality and uses sharia as its legal code in addition to the national criminal code.
Endin Saprudin, a sharia police officer at the Aceh provincial administration, said the men would be free once they had been caned.
The worldly punishment is completed after the execution of the sentence, Mr Endin said.
However I don't know about the punishment of the afterlife, whether or not they will be caned again. At least we have saved some Muslims by showing them such actions are clearly prohibited.
On March 28, vigilantes broke into an apartment in Banda Aceh, Aceh's capital, and took the two men to the police after catching them in bed together.
LGBT rights advocacy group Arus Pelangi said a video of the two men had gone viral, which put them at risk and should never have been circulated.
Can you imagine the caning being carried out in front of so many people? said chairwoman Yuli Rustinawati.
Obviously it is painful to be caned but then many people are watching. It creates another pain psychologically, not only for the offenders but also for their families.
The men represented themselves in court and accepted their punishment.
Mr Endin, the sharia police officer, said they had been entitled to a lawyer but questioned why they would need one when they were caught red-handed.
The pictures obviously show they committed a homosexual act, he said.
Prosecutors requested 80 lashes but the judges imposed a harsher sentence of 85, of which 83 were delivered.
Human Rights Watch had called on Indonesian President Joko Widodo to intervene and stop the public flogging.
The court's less-than-maximum sentence of 85 lashes is no act of compassion. It does not change the reality that flogging is a grotesque display of medieval torture,said Human Rights Watch deputy Asia director Phelim Kine.
Muhammad Iswanto, another sharia police officer, said data showed that no one punished under sharia law in Aceh had repeated their crime.
In the whole Aceh province, for all offences such as khamar (alcohol), zinah (adultery), until now we do not have a recidivist," he said.
Moammar, a 20-year-old chemistry student, came to watch the caning with nine of his friends from campus. I am curious because this is the first caning on a liwath case,Moammar said.
I want this case to be the first and last case of homosexuality.
The central government in Jakarta granted Aceh's religious leaders the right to impose sharia-inspired law in 2001 as part of a deal struck to quell a decades-long separatist movement in the province.
But Ayi, a Banda Aceh resident who lives in the same neighbourhood as one of the gay men, said caning was another form of violence.
We had 30 years of conflict. But now we have this, she told Fairfax Media.