India's top court has agreed to re-examine a colonial-era law that criminalizes homosexual acts and makes them punishable by up to a decade in prison.

The Supreme Court on Tuesday set up a five-judge panel to reconsider its 2013 ruling that only Parliament can change the 1861 law banning gay sex.

Gay activists cheered the court decision and said they were hopeful that the verdict would ultimately go in their favor and they would have the chance to live openly.

In 2009, a New Delhi High Court declared unconstitutional Section 377 of the Indian Penal Code, which says intercourse between members of the same sex is against the order of nature.

But the judgment was overturned four years later by the Supreme Court. Activists sought a review of the decision.