Pakistan's parliament has approved a law guaranteeing basic rights for transgender people in a country which sees prevalent discrimination.

The Transgender Persons (Protection of Rights) act was passed by a majority in the National Assembly in Islamabad.

The law bans discrimination against transgender people by employers and business owners as well as outlawing harassment in public places or at home.

It also allows transgender people to self-identify as male, female or a "third sex" on official documents, such as passports or driver's licenses.

Transgender in Pakistan Show all 16 1 /16 Transgender in Pakistan Transgender in Pakistan Dancing at Shakeela's party, an event to celebrate a transgender life in middle-age Reuters Transgender in Pakistan Venue staff members watch people dance at Shakeela's party in Peshawar, Pakistan Reuters Transgender in Pakistan Security searches guests as people arrive at Shakeela's party in Peshawar, Pakistan Reuters Transgender in Pakistan Members of the transgender community dance at Shakeela's party in Peshawar, Pakistan Reuters Transgender in Pakistan Shakeela, a member of the transgender community, works in the kitchen at home in Peshawar, Pakistan Reuters Transgender in Pakistan 'It's the first time a transgender party has been held openly,' says activist Farzana Jan Transgender in Pakistan Farzana Jan, a member of the transgender community, poses for a photographer ahead of Shakeela's party in Peshawar, Pakistan Reuters Transgender in Pakistan Guests at Shakeela's party Reuters Transgender in Pakistan Money thrown by the guests is used by people to help them start a new business or project Transgender in Pakistan Rani smiles from behind her make-up as she prepares for the party Reuters Transgender in Pakistan Shakeela resting at her home in Peshawar Reuters Transgender in Pakistan A photo hangs on the wall in the home of members of the transgender community in Peshawar, Pakistan Reuters Transgender in Pakistan Make up lies on the floor as members of the transgender community prepare for Shakeela's party in Peshawar, Pakistan Reuters Transgender in Pakistan A guest counts money she plans to throw at Shakeela's party Reuters Transgender in Pakistan Bubbly helps Shakeela with her dress as members of her own family watch on Reuters Transgender in Pakistan Chahat, a member of the transgender community, prepares for Shakeela's party in Peshawar, Pakistan Reuters

Transgender people routinely face severe discrimination in Pakistan.

Many struggle to find jobs and have been attacked, murdered and raped.

Some "hijras," the term given to transgender people, intersex people and eunuchs, are forced to work as sex workers, dancers or beggars.

The new law also establishes safe houses for transgender people, as well as providing medical care and psychological counselling.

Having passed through the National Assembly, it now needs to be signed into law by the country's president, Mamnoon Hussain.

Transgender Day of Visibility: Trans people share their stories

Last year, Pakistan's transgender community was counted in the national census for the first time, which recorded 10,418 transgender people in a population of around 207 million.

However, the charity Trans Action Pakistan said the figure was likely to be a significant underestimate.

It believes there are at least half a million transgender people in the conservative South Asian nation.

Earlier this year, a woman disowned by her family became the country's first transgender newsreader.