The decision by five judges marks a major victory for gay rights in a country of 1.3 billion people.
Activists had campaigned for years to remove Section 377 of the Indian penal code, which stigmatized homosexuality and served as a pretext for harassment and blackmail.
“Respect for individual choice is the essence of liberty,” Dipak Misra, India’s chief justice, told a packed courtroom. “This freedom can only be fulfilled when each of us realizes that the LGBT community possesses equal rights.”
Activists have struggled for more than a decade to invalidate Section 377 of the Indian penal code, a provision that dates to the colonial era. The law prohibited consensual “carnal intercourse against the order of nature.”
While the statute was rarely used as a basis for prosecution, its presence meant that gay people faced threats, harassment and blackmail. It also served as a constant reminder to the gay community that the state considered their sexuality illegal.