LGBT history in Pakistan

Royalty of Transgenders; Under the Mughal rule, Transgenders were called Khawjasaras, a designation of respect and dignity. The Mughals employed transgenders as security officials in charge of female quarters. This role was assigned to transgenders in imitation of their historic role in Holy Cities where transgenders served as facilitators between men and women performing Prayers and Pilgrimage. In most parts of the Muslim world, transgenders commanded respect and were considered holy and special in the eyes of the Lord. The spirituality of transgenders is considered as authentic as that of men and women. The Prophet of Islam treated transgenders with respect, prohibited their ill-treatment, and had good things to say about spiritually-inclined transgenders. Believing that transgenders are dearer to God (The Creator), some Muslim rulers appointed them as intercessors in Royal Palaces, including those of the Ottomans and the Mughals.
In the Indus Valley Region i.e. (Pakistan), the Mughals appointed transgenders to positions of power and trust. Transgenders served as courtiers and councils, giving advice to Princes and Princesses. They were familiar with court etiquettes and knew the secret workings of Mughal households. They were domestic insiders. Having the controls of intelligence officers and the prestige of Royal confidantes, transgenders enjoyed special powers and privileges unavailable even to the most powerful Wazirs (ministers) of the Islamic Kingdom. Transgenders were educated in statecraft and nuances of religion. This treatment and elevation in the Mughal courts provided a great incentive for non-Muslim transgenders to accept Islamic faith.
The Qur’an is clear on genetic determinations by pointing out that Allah is the
Every child — male, female, or transgender—has the equal blessings of the Lord and there is no justification for parents, courts, or governments to engage in gender-based ill-treatment.