India's Supreme Court has struck down a colonial-era law criminalizing consensual gay sex, overturning more than 150 years of anti-LGBT legislation.

The landmark decision Thursday by five Supreme Court judges to repeal the law and legalize gay sex between consenting adults comes as a major victory for India's LGBT activists and supporters after years of determined struggle.

Section 377, an archaic law imposed during British rule that penalized intercourse "against the order of nature," had carried a maximum sentence of life imprisonment.

For the lawyers representing more than a dozen gay and lesbian Indians who petitioned the court, the legal acceptance of same-sex relations finally signals an end to the harassment and persecution of the LGBT community.

Though the law was rarely enforced in full, it helped create a culture of fear and repression within the LGBT community, said campaigners. A change in legislation "creates a space of freedom where you can start expecting justice," Danish Sheikh, a law professor at Jindal Global Law School and LGBT advocate, told CNN. (CNN)