The story of Section 377 dates back to 1861, when the British criminalised sexual activities against the order of nature, including homosexual sexual activities in India.
As the court delivered its verdict, striking down Section 377, here's a chronology of events relating to proceedings on the issue.
Naz Foundation, a non-governmental organisation fighting for gay rights, files a public interest litigation in the Delhi high court, seeking legalisation of gay sex among consenting adults.
September: The high court dismisses the PIL seeking de-criminalisation of gay sex. Gay right activists file review petition.
November 3: HC dismisses the review plea.
December: Gay rights activists approach SC against HC order.
April 3: SC remands the case back to the Delhi HC, directs it to reconsider the matter on merit.
October 4: The high court allows senior Bharatiya Janata Party leader B P Singhal’s plea, opposing decriminalising gay sex, to be impleaded in the case.
September 18: The Centre seeks more time to take a stand on the issue after contradictory stands between the ministries of home affairs and health over decriminalisation of homosexuality. HC refuses the plea and final argument in the case begins.
September 25: Gay rights activists contend that the government cannot infringe upon their fundamental right to equality by criminalising homosexual acts on the ground of morality.
September 26: HC pulls up the Centre for speaking in two voices on homosexuality law in view of contradictory affidavits filed by the MHA and health the ministry.
September 26: The Centre says gay sex is immoral and a reflection of a perverse mind and its decriminalisation would lead to moral degradation of society.
October 15: HC pulls up the Centre for relying on religious texts to justify ban on gay sex and asks it to come up with scientific reports to justify it.
November: The government in its written submission before HC says judiciary should refrain from interfering in the issue as it is basically for Parliament to decide.
November 7: HC reserves verdict on pleas filed by gay rights activists seeking decriminalisation of homosexual acts.
July 2: HC allows plea of gay rights activists and legalises sexual activity among consenting adults of same sex.
July 9: Delhi astrologer challenges the HC verdict in the SC. Later, several others -- including BJP leader Singhal (since dead), religious organisations, rights activists and yoga guru Ramdev’s disciple -- also oppose the judgement.
February 15: SC begins final day-to-day hearing in the case.
Mar 27: SC reserves verdict.
Dec 11: SC sets aside the 2009 Delhi HC order which had decriminalised gay sex.
Dec 20: The Centre files review petition in the SC seeking re-examination of its verdict.
Dec 24: Gay rights activists file review petition in the SC seeking re-examination of its verdict.
Jan 28: SC refuses to review its verdict on criminalising gay sex, dismisses pleas of Centre, activists.
Apr 3: SC agrees to consider for an open court hearing on curative petitions filed by gay rights activists against its verdict criminalising homosexuality.
Feb 2: SC refers curative pleas on homosexuality to five-judge bench.
July 10: A five-judge Constitutional bench, led by Chief Justice of India Dipak Misra and comprising Justices R F Nariman, A M Khanwilkar, D Y Chandrachud and Indu Malhotra, begins hearing petitions challenging Section 377.
July 11: The Supreme Court said the right to sexual orientation is not a fundamental right but indicated that the right to choose a sexual partner is a fundamental right.
The Centre also said that they were leaving it up the to the wisdom of the court to examine the constitutional validity of Section 377, but said that if the right to choose a sex partner was recognised as a fundamental right, then somebody may come up and say that he or she wanted to marry a sibling, which would be contrary to the laws governing marriages.