Same-gender sexual activities between men (even in private and consensual) are illegal, and punishable with a maximum penalty of life imprisonment. Sex acts between women are not mentioned specifically in mainland Tanzanian law. The semi-autonomous region of Zanzibar outlaws same-gender sexual acts between women with a maximum penalty of 5 years of imprisonment or a 500,000 shilling (190 €) fine. Same-gender couples have no legal recognition. Heterosexual oral or anal sex is also illegal; however, those laws are rarely applied. The Government has increasingly resorted to homophobic rhetoric, believing that homosexuality is "un-African". Neither the Constitution nor the statutes of Tanzania specifically prohibit discrimination based on sexual orientation or gender identity. Transgender people are not recognised in Tanzania and the authority does not allow citizens to change their gender and name. Gay men were forced to endure anal examinations and torture.
Homosexuality in Tanzania is a socially taboo topic. General social stigma against LGBTQIA+ populations is particularly heavy. According to a survey, 95% of Tanzanian residents believed that homosexuality is a way of life that society should not accept. LGBTQIA+ communities experience discrimination from family members, removal from school, derogatory and hate language, police harassment (mistreated, hated, ostracised, beaten with belts, stripped naked and, in one case, corrective rape). Transgender and intersex identities are also received incredulously by police authorities. There is also evidence of discrimination in housing, education and employment against LGBTQIA+ persons. In recent years, Tanzania has become particularly hostile to LGBTQIA+ people. Even in comparison to other countries that criminalise same-gender relations, Tanzania has become an outlier in its efforts to render LGBTQIA+-friendly health services inaccessible. In October 2017, the government deported several HIV/AIDS groups based on "promoting homosexuality".
There is evidence of arbitrary arrests of LGBTQIA+ activists in 2009. In July 2012,LGBTQIA+ activist Morris Mjomba was murdered in Dar es Salaam. Two following organisations have been registered through ILGA which might be active in LGBTQIA+field: Community Health Education ServicesAdvocacy and Morogoro Saving the Poor Organization (MOSAPORG)
Access to refugee protection in neighbouring countries is virtually impossible for LGBTQIA+ applicants, given that claims based on sexual orientation are not recognised. For example, a recent case of a Tanzanian gay man, whose request for protection on grounds of sexual orientation was rejected in Malawi, Zambia and Zimbabwe. Some of LGBTQIA+ individuals flee their home country from the persecution and violence and go to a safer destination in European and North American countries.