Same-sex intercourse carries the death penalty in five officially Muslim nations: Saudi Arabia, Iran, Mauritania, Sudan, and Yemen.
[3] It formerly carried the death penalty in Afghanistan under the Taliban, and in Iraq under a 2001 decree by Saddam Hussein. The legal situation in the United Arab Emirates is unclear. In many Muslim nations, such as Bahrain, Qatar, Algeria or the Maldives, homosexuality is punished with jail time, fines or corporal punishment. In some Muslim-majority nations, such as Turkey, Jordan, Egypt, or Mali, same-sex intercourse is not forbidden by law. However, in Egypt gays have been the victims of laws against "morality".
In Saudi Arabia, the maximium punishment for homosexuality is public execution, but the government will use other punishments, i.e. fines, jail time and whipping as alternatives, unless it feels that homosexuals are challenging state authority by engaging in a gay rights movement.
[4] Iran is perhaps the nation to execute the largest number of its citizens for homosexuality. Since its Islamic revolution in Iran, the Iranian government has executed more than 4000 people charged with homosexual acts. In Afghanistan after the fall of the Taliban homosexuality went from a capital crime to one that it punished with fines and prison sentence, and a similar situation seems to have occurred in Iraq.