In a historic ruling, the Supreme Court of India has recognized transgender people as a third gender.

The Tuesday ruling gives more rights and privileges to transgenders, who make up two million of India's population and don't identify themselves as male or female, the BBC reported.

"It is the right of every human being to choose their gender," the court said according to the BBC.

Transgender people will now be offered the same welfare programs that are offered to those who are poor, including education, jobs and healthcare, the Associated Press reported.

The third gender are often treated as outsiders, living in poverty and earning a living by begging, singing, dancing and prostitution, according to the BBC. They are even turned away from hospitals.  

Before the ruling, transgenders were forced to identify themselves as either male or female on public documents.

"Recognition of transgenders as a third gender is not a social or medical issue but a human rights issue," Justice KS Radhakrishnan, head of the Supreme Court bench, said in his ruling.

"Transgenders are also citizens of India," and they must be "provided equal opportunity to grow," the court said according to the BBC. "The spirit of the Constitution is to provide equal opportunity to every citizen to grow and attain their potential, irrespective of cast, religion or gender."  

Trangenders were not always ostracized. They held prominent positions in the Mughal Empire, and are mentioned in ancient Hindu texts and epic poems, the BBC reported.

But their reputation took a turn for the worst in the 18th century when India was a colony of Britain. Transgenders were labeled as "criminals" and were jailed for wearing women's clothing or having gay sex, the BBC reported.

For transgender activist Laxmi Narayan Tripathi, the ruling is a step in the right direction for a community that has endured discrimination from society, according to the BBC.  

"Today, for the first time I feel very proud to be an Indian," Tripathi said according to the BBC.