The Transgender Persons (Protection of Rights) Act defines gender identity as “a person’s innermost and individual sense of self as male, female or a blend of both or neither.” The measure allows citizens to choose their gender identity, and to have it reflected on all official documents, including driver’s licenses and passports. The legislation also outlaws all discrimination against transgender people in workplaces, schools and health care settings such as doctor’s offices.

Members of the Pakistani parliament passed the bill in Islamabad on Tuesday and it now goes to President Mamnoon Hussain to be signed into law. It’s unclear when the legislation would take effect, NPR noted.

The bill separates transgender people into three categories: intersex (known in Pakistan as “Khunsa”); eunuchs, who are assigned male at birth but undergo genital castration; and transgender men or women. In Pakistan, transgender people are often referred to as “KhawajaSira,” defined in the legislation as “any person whose gender identity and/or gender expression differs from the social norms and cultural expectations based on the sex they were assigned at the time of their birth.”

“Transgender people constitute one of the most marginalized communities in the country and they face problems ranging from social exclusion to discrimination, lack of education facilities, unemployment, lack of medical facilities and so on,” the bill reads.

The legislation does not include protections for gay, lesbian or bisexual citizens.

“I heard about this yesterday morning and I was in a state of shock because I never thought something like this could happen within my own life in Pakistan,” Mehlab Jameel, an activist from Lahore, who helped write the bill, told NPR. “This kind of development is not only unprecedented in Pakistani history, but it’s one of the most progressive laws in the whole world.”

Pakistan’s population of 207 million includes a little over 10,000 transgender people, according to a 2017 census. Trans Action Pakistan reports that the trans community is often subjected to extreme violence, including sexual assault, rape, torture and execution. Trans people are often forced to resort to sex work or begging in order to survive.

As Amnesty International’s Pakistan researcher Rabia Mehmood told Al Jazeera, passage of the bill shows progress, but executing it will be key.

“This bill makes Pakistan one of the few countries in the world to recognize the self-perceived gender identity of transgender individuals,” Mehmood said. “The country’s transgender community has very high hopes from this bill. Its implementation is therefore crucial to ensure they can live their lives with dignity and respect.”