A group of over 50 Muslim clerics in Pakistan have issued a fatwa, or religious decree, saying transgender men and women have the right to marry under Islamic law, and have urged the state to provide protection and ensure equal rights for them.

The move has been cautiously welcomed in Pakistan, though activists say aspects of the law need to change in order to protect the country’s shunned transgender community known as “hijra,” or “khawaja sara.”

The fatwa was issued by the group Tanzeem Ittehad-i-Ummat Pakistan from the eastern city of Lahore, whose leaders said any action intended to “humiliate, insult or tease” transgender people should be considered a crime under Islam.

The group’s chairman, Zia-ul-Haq Naqshbandi, said the decree was designed to prevent discrimination.

He said: “We need to accept them as God’s creation too. Whoever treats them badly - society, the government, their own parents - are sinners.”

Despite Tanzeem Ittehad-i-Ummat Pakistan not being among the country’s most senior religious groups, the fatwa was discussed on national television, with senior clerics saying the rights were already outlined in Islam.

But the details of the fatwa have led critics to call for greater protection for transgender people.

The decree says that people with visible signs of being male, or visible signs of being female, may marry members of the opposite sex, but those with “visible signs of both genders” may not marry.

“I don’t quite understand it. They’ve said trans men can marry women, and trans women can marry men. The transgender identity is nowhere,” Bindiya Rana, a transgender rights activist from Karachi, told the Wall Street Journal.

Almas Bobby, a transgender rights activist, told BBC Urdu: “We are glad that somebody's talked about us.

“By Sharia we already had the right [to marry], but unless measures are taken to remove the misconceptions about us in society, the condition of our community will not be changed.”

Transgender people face severe prejudice in Pakistan. More than 45 transgender people have been killed in the Khyber Pakhtunkhwa province over the past two years, according to local rights group Trans Action.

In pictures: Pride in London 2016 Show all 10 1 /10 In pictures: Pride in London 2016 In pictures: Pride in London 2016 Pride in London Participants on motor cycles during the Pride in London parade, as it makes its way through the streets of central, London. AFP/Getty Images In pictures: Pride in London 2016 Pride in London Daphne, a miniture schnouzer, wears a rainbow tie at a march as the LGBT community celebrates Pride in London on June 25, 2016 Getty Images In pictures: Pride in London 2016 Pride in London Jennifer Saunders (right) and Joanna Lumley (left) pose in character along with performers in front of the Absolutely Fabulous/Stolli (vodka) Pride in London float PA In pictures: Pride in London 2016 Pride in London 'Pet Play' enthusiasts dress and behave as dogs during a march as the LGBT community celebrates Pride in London on June 25, 2016 Getty Images In pictures: Pride in London 2016 Pride in London A policeman kisses his fiance after proposing to him during the Pride in London parade, as it makes its way through the streets of central London. PA In pictures: Pride in London 2016 Pride in London Participants show their support for victims of the Orlando shooting during the annual Pride Parade in London on June 25, 2016. AFP/Getty Images In pictures: Pride in London 2016 Pride in London United States Ambassador to the United Kingdom Matthew Barzun (left) and Major of London Sadiq Khan attending the Pride in London parade PA In pictures: Pride in London 2016 Pride in London Participants take part in the annual Pride Parade in London on June 25, 2016. AFP/Getty Images In pictures: Pride in London 2016 Pride in London Participants take part in the annual Pride Parade in London on June 25, 2016. AFP/Getty Images In pictures: Pride in London 2016 Pride in London Participants show their support for victims of the Orlando shooting during the annual Pride Parade in London on June 25, 2016. AFP/Getty Images

Qamar Naseem, the co-founder of the group, said the fatwa now needs to be tested legally.

He said: “They’ve opened a window, and other windows will open because of this, because the religious community has started a conversation.”