Two men were arrested in Indonesia's North Sulawesi province after one of them posted photos on Facebook showing them kissing in bed, police said Thursday.
In the photos the two men, aged 22 and 24, were kissing while shirtless, with a message that read: "With my dear lover tonight. May our love last forever."
Local police released a statement confirming they had responded to "LGBT pornography in the form of two men canoodling."
The two men admitted they were the people in the photos, police said.
They could face up to seven years in jail if found guilty of posting lewd materials online.
Indonesia, the world's most populous Muslim-majority country, has seen growing hostilities against sexual minorities.
The government has sought to block gay-friendly mobile applications in Google and Apple app stores that it says promote "sexual deviance."
It has also requested social networking services such as Line and Twitter to remove emoticons depicting same-sex couples for the Indonesian market.
Anti-gay sentiment began rising earlier this year after Higher Education Minister Muhammad Nasir warned of pro-LGBT activities on university campuses and banned such groups.
Since then, officials and conservative religious groups have made statements denouncing pro-LGBT activities.