NEW DELHI — Even as gay activists in India celebrated on Friday, a day after a landmark Supreme Court ruling ended the country’s ban on gay sex, they were preparing for resistance to the decision.

Among the pressing questions left unresolved by the ruling: Will the authorities drop the countless criminal cases that had been filed under the Victorian-era law that had made consensual gay sex a crime? What will happen if a gay couple shows up at a registrar’s office and asks to be married? Will gay people be able to pursue cases of harassment based on sexual orientation?

At the forefront of many people’s minds was how to translate the court’s lofty language — “History owes an apology” to gay people, one justice said — into practical gains. India is still a deeply conservative, incredibly diverse nation of 1.3 billion that often feels more like a continent than a country.

Keshav Suri, 33, a Delhi-based hotelier and one of the more than two dozen petitioners in the case, was feeling rather optimistic on Friday. He said he hoped the ruling would be used to address hate speech against gay people. Personally, he said, he was planning to seek legal recognition of his recent marriage to a Frenchman.

Going back to court doesn’t scare him one bit.

“I am for sure happy, ready, willing and able to file a writ petition again on marriage equality and take that battle on,” he said. “I am pretty sure others, too, are willing to do so.”

Whether gay Indians succeed in that battle, he said, will be up to judges and “brave souls willing to fight and put themselves out there for equality.”

Akhilesh Godi, 25, a data scientist in Bangalore who also was part of the case, was a bit more sober. Around the time he came out a couple of years ago, he struggled with depression that led him to lose 15 pounds in two weeks and consider whether he should “give up his life.”

Though he was very encouraged by the court’s decision, he wondered what implementation would actually mean, given that other progressive rulings by the Supreme Court, including one in 2014 that recognized a third gender category, have essentially been ignored in many parts of India.

Part of the reason for this, he said, is that leading political figures, including Prime Minister Narendra Modi, have studiously avoided the gay rights debate.

“They refuse to even comment,” he said.

Before the ruling, Mr. Modi had taken no position on the law, saying the court should decide its fate. And he said nothing about it after, even as the groundbreaking decision dominated the national conversation.

Participants in the upcoming Miss Transqueen India competition at a nightclub in New Delhi on Friday.CreditNoemi Cassanelli/Agence France-Presse — Getty Images

Still, Mr. Godi said, there is greater space now for measures like introducing stronger sex education in classrooms and expanding sensitivity training for police officers.

“The ruling gives us a lever for the future,” he said.

The court ruled that Section 377 of the Indian Penal Code, which had been introduced by British colonizers in the 1860s to prohibit sexual acts considered “against the order of nature,” could no longer be applied to gay sex.

Historians say India was relatively tolerant of gay and transgender people before the British introduced more restrictive social mores.

Many gay activists said Friday that they were unsure how far the ruling would be applied or whether it would eradicate other forms of discrimination. But they all seemed to agree it was a moment to savor.

After the judges relayed their decision, the news rocketed around India, with people kissing, crying, drinking and shooting off blasts of confetti. Many were exhausted on Friday — but still celebrating.

Chayanika Shah, 60, a member of a collective she described as “women loving women,” read parts of the judgment aloud at a bar in Mumbai. Shankar Yadav, 20, and his friends shared a pineapple cake in the central city of Raipur and then “danced in the streets to our heart’s content.”

One thing is certain: The ruling has invigorated the growing coalition of gay rights groups in India. The biggest organizations are confined to large cities like New Delhi and Mumbai. In rural parts of the country, activists work remotely, in sometimes hostile conditions and without the protection of a parent organization.

But public perception is changing, and so is the profile of gay groups. Pride parades, once small affairs in urban centers where many people showed up wearing masks to shield their identities, now attract thousands dancing openly in the streets. More recently, parades have sprung up in smaller state capitals like Bhubaneswar and Bhopal.

The effort to strike down Section 377 has been underway for years. It picked up steam in 2000, when a terrified young man went to the Naz Foundation, one of the few H.I.V. advocacy organizations in India, pleading for help because his parents had forced him to undergo electroshock therapy at a government hospital to make him straight.

Anjali Gopalan, who runs the organization in New Delhi, was so horrified at what the young man told her that she filed a lawsuit challenging Section 377, setting the case in motion. She has received death threats for years as a result.

One of the most unequivocal public statements on the ruling was the front page on Friday of The Indian Express, perhaps the country’s most respected English-language newspaper.