ISLAMABAD - Pakistan's marginalized transgender community on Wednesday welcomed the government's decision to issue its first passport with a transgender category as an important milestone in the struggle against discrimination.

The conservative South Asian nation, where homosexuality is a crime, last week issued a passport to prominent transgender activist Farzana Riaz with an X to symbolize the third sex printed under the gender category of the travel document.

Pakistani transgender Farzana Riaz displays her newly-obtained passport in Peshawar on June 28, 2017. ABDUL MAJEED / AFP - Getty Images

Riaz, who is president of the charity Trans Action Pakistan, said the introduction of the X classification - along with M for Male and F for Female - was a significant step in the community's fight for legal recognition in Pakistan.

"Men and women both have been given their identity, but we were deprived of this right. We are happy there is a growing realization that we should be given our identity," Riaz said by phone from the northwest city of Peshawar.

"We also want to see how the outside world is. But we have been facing many problems with regard to complications in our travel documents. But, thank God, this issue has now been resolved," she told the Thomson Reuters Foundation.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Related: Court Reopens Intersex Passport Lawsuit Against State Department

There is no official data on the population of transgender people in Pakistan, but Trans Action Pakistan estimates the number is at least half a million in a country of 190 million.

Trans people technically enjoy better rights in Pakistan than in many other nations across the world, but in practice they are marginalized and face discrimination when it comes to health, education and jobs. They often face violence and stigma.

The country's Supreme Court has in recent years taken steps towards recognizing their basic rights. In 2009, the court ruled that "hijras" - which include transvestites, transsexuals and eunuchs - could get national identity cards as a "third sex."

Since then it has also declared equal rights for transgender people, including the right to inherit property and assets, the right to vote and to be counted as a separate category in the country's national census.

Related: 'Visibility Project' Portraits Show LGBTQ Asian Americans in All Their Power

Yet many hijras in Pakistan, as well as other South Asian nations such as India and Bangladesh, are attacked, murdered, raped or forced to work as sex workers to support themselves. Others eke out a living by begging for alms on the streets.

Last year there was a spate of attacks on transgender people in the northwest province of Khyber Pakhtunkhwa, where Peshawar is the capital city.

After one attack, an activist died in the hospital after being shot multiple times by a friend. Her friends accused the hospital of delays in her treatment, with staff unsure whether to admit her to a male or female ward.

"The main challenge for us is to change society's behavior," Riaz said. "We have largely been confined to the four walls of our houses because we are harassed, terrorized and ridiculed by the people."

Follow NBC Out on Twitter, Facebook & Instagram