Islam teaches that sexual relations are lawful only between a husband and wife, so same-sex acts are considered sinful, as the story of Lot's people in the Quran also describes. At the same time, Islam forbids harassing, insulting or attacking anyone, and a person's heart and faith are known only to God.
The fuller answer
The mainstream view of all Muslim schools is that same-sex acts are forbidden. Many Muslim scholars separate between feeling an attraction, which is not a sin as it is not chosen, and acting on it. Classical law set a very high level of proof, and Muslims are told not to spy on one another or expose private sins.
Muslims differ in practice. In some countries, same-sex relations are criminalised, and the treatment of LGBT people in some communities is harsh. Many Muslims say that violence and hatred have no basis in Islam, and a growing number of Muslim voices call for compassion. Others disagree with the traditional view altogether. Western readers should know the view is a doctrinal position of belief on sexual morality and not a reason to harm anyone.
And [We had sent] Lot when he said to his people, "Do you commit such immorality as no one has preceded you with from among the worlds? Indeed, you approach men with desire, instead of women. Rather, you are a transgressing people."
O you who have believed, avoid much [negative] assumption. Indeed, some assumption is sin. And do not spy or backbite each other. Would one of you like to eat the flesh of his brother when dead? You would detest it. And fear Allah; indeed, Allah is Accepting of repentance and Merciful.
O you who have believed, let not a people ridicule [another] people; perhaps they may be better than them; nor let women ridicule [other] women; perhaps they may be better than them. And do not insult one another and do not call each other by [offensive] nicknames. Wretched is the name of disobedience after [one's] faith. And whoever does not repent - then it is those who are the wrongdoers.
This answer follows the mainstream Sunni understanding and is general learning, not a fatwa. Where Muslims differ, the answer says so. Have a question of your own? Write to us.