The court made the decision on Monday following a petition from a transgender who wanted a third category introduced on passports for people who identify themselves neither as male nor female, the spokesman said.
"The Supreme Court ruled on the writ petition seeking the new category. The court has ordered the government to implement the decision," Hemanta Rawal told AFP.
The move comes more than six years after the court ordered the government to enact laws to guarantee the rights of transgender, gay, lesbian and bisexual people.
Early this year, Nepal introduced a transgender category for people obtaining their citizenship certificates. People can register as a "third gender" when completing the certificates, which serve as national identity cards required to open bank accounts, sell and buy property and get a passport.
Sunil Babu Pant, director of the Blue Diamond Society, a gay rights group, welcomed the court's decision.
"We are very happy with this. This decision has made it easier for those who identify themselves as 'third gender'. Now they can travel abroad carrying a passport which gives them a recognition," Pant said.