Here's your 10-point cheat sheet to this big story:
"We have to bid adieu to prejudices and empower all citizens," said Chief Justice Misra, reading out what he said was a consensus judgment. The judges also said: "Any discrimination on the basis of sexuality amounts to a violation of fundamental rights".
They also said that "consensual carnal intercourse among adults, be it homosexual or heterosexual, in private space, does not in any way harm the public decency or morality".
Section 377, which is part of an 1861 law, banned "carnal intercourse against the order of nature with any man, woman or animal" -- which was interpreted to refer to homosexual sex.
A part of that law still remains; non-consensual or consent obtained by force continues to be an offence, as will "carnal intercourse with children, animals and bestiality".
The verdict is being cheered by millions across the country, far beyond the gay community, which has fought for decades for the right to be treated equally.
The historic judgment acknowledged their struggle as it noted "158 years ago, the law deprived people of love." The judges said: "Respect for individual choice is the essence of liberty; LGBT community possesses equal rights under the constitution."
The ban on gay sex was challenged by five high-profile petitioners -- from a classical dancer to a celebrity chef and a hotel chain owner -- who said they were living in fear of being punished.
The petitions were opposed by Christian bodies like the Apostolic Alliance of Churches and Utkal Christian Association, besides some other NGOs and individuals.
The homosexual community had a five-year reprieve after the Delhi High Court in 2009 described Section 377 as a violation of the fundamental rights guaranteed by the constitution and removed the ban. It had responded to a petition by Naz Foundation, which has fought for almost a decade for gay rights.
In 2013, the Supreme Court cancelled the Delhi high court order and restored the ban on homosexuality, saying it was the job of parliament to decide on scrapping laws. The Supreme Court this year said the court "cannot wait for a majoritarian government" to decide on enacting, amending or striking down a law if it violates fundamental rights.
Supreme Court Gets 2 New Judges, First From Manipur Couple Awarded 6 Months In Jail For Bigamy, But With Alternate Prison Time Will Give Land For Bombay High Court Building: Maharashtra To Supreme Court Trump's Vice President Pick Reveals How His Hindu Wife Helped Him "Someone Must Have Doubted...": Doctor On Trainee IAS Officer's Disability Claim Engineer Stole NEET Question Paper From Exam Body's Trunk, Arrested By CBI Vicky And Birthday Girl Katrina Unlock Core Memories In Adorable Ways Roberta Metsola Re-Elected As European Parliament Chief Jaro Education Works Closely With Senior Executives From Corporates To Build Future Leaders Track Latest News Live on NDTV.com and get news updates from India and around the world.