NEW DELHI — India’s Supreme Court on Tuesday started hearing a challenge to one of the world’s oldest laws criminalizing consensual gay sex, a debate that has raised broader questions about how far to extend equal rights in the country.

Lawyers representing a cluster of gay and lesbian Indians who petitioned the court said the law, known as Section 377, was an archaic holdout from India’s colonial era.

“We are asking for a declaration that our rights are protected,” one of the lawyers, Mukul Rohatgi, argued before five judges. The court will most likely reach a verdict in a few weeks.

The question of how far safeguards should stretch for gay, lesbian, bisexual and transgender Indians pumped a bit of tension into the courtroom. When Mr. Rohatgi veered into a discussion of other rights for gay people, saying that “what happens in a bedroom is not the end-all, be-all,” Dipak Misra, the chief justice of the court, swiftly steered him back to the constitutionality of Section 377.