Before the Islamic Revolution in 1979, the issue of trans identity in Iran had never been officially addressed by the government. Beginning in the mid-1980s, however, transgender individuals were officially recognized by the government and allowed to undergo sex reassignment surgery. As of 2008, Iran carries out more sex change operations than any other nation in the world except for Thailand. The government provides up to half the cost for those needing financial assistance, and a sex change is recognised on the birth certificate.
In 1963, Ayatollah Ruhollah Khomeini wrote a book in which he stated that there was no religious restriction on corrective surgery for intersex individuals, though this did not apply to those without physical ambiguity in sex organs. At the time Khomeini was a radical, anti-Shah revolutionary and his fatwas did not carry any weight with the Imperial government, which did not have any specific policies regarding transgender individuals.
The new religious government that came to be established after the 1979 Iranian Revolution classed transgender people and crossdressers with gays and lesbians, who were condemned in shah's era and faced the punishment of lashing or even death under Iran's penal code.
One early campaigner for transgender rights was Maryam Hatoon Molkara, who had been assigned male at birth but identified as female. Before the revolution, she had longed to become physically female but could not afford surgery and wanted religious authorization. In 1975, she began to write letters to Khomeini, who was to become the leader of the revolution and was in exile. After the revolution, she was fired, forcedly injected with male hormones, and institutionalized. She was later released with help from her connections and continued to lobby many other leaders. Later she went to see Khomeini, who had returned to Iran. During this visit, she was subjected to beatings from his guards. Khomeini, however, did give her a letter to authorize her sex reassignment operation, which she later did in 1997. Due to this fatwa, issued in 1987, transgender women in Iran have been able to live as women until they can afford surgery, have surgical reassignment, have their birth certificates and all official documents issued to them in their new gender, and get married to men.