A woman watches her newborn daughter at the Gurgaon Hospital outside of New Delhi. Up to 50 million girls and women are missing from India’s population as a result of sex discrimination, according to the United Nations Children’s Fund. (Monique Jaques)

As thousands of young Indians thronged New Delhi’s streets to protest a brutal gang rape last month, 25-year-old Pooja Patil said, many of her friends in this seaside metropolis held candlelight ­marches instead of new year’s parties. Others replaced their Facebook profile pictures with a single black dot as a symbol of mourning.

They were part of what news media reports heralded as an Indian middle class jolted into action by the shocking assault that led to the young woman’s death. Yet the same demographic group is also at the heart of an illegal practice that experts say contributes to violence and deep-seated discrimination against women in this rising economy: sex-selective abortion.

This nation’s child-gender ratio — the number of girls to boys — is at its most lopsided in 50 years, as a growing number of couples opt to abort female fetuses or neglect infant girls in their desperation for sons. While it is often assumed that uneducated, rural Indians are the most likely to shun daughters, researchers say the practice is quickly growing in the urban enclaves where incomes are rising — and whose inhabitants are poised to play a key role in shaping what is due to be the world’s most populous nation by 2025.

More than 40 percent of Indians will belong to the middle class in 2030, up from 12 percent in 2010, according to McKinsey, the New York-based consultancy. Many such families “want a son to take forward their business,” Patil, a chemistry lecturer, said as she walked one recent afternoon along a coastal promenade popular with joggers and couples in Worli, a neighborhood in Mumbai’s G-South ward.

Nationwide, there are just 914 girls age 6 and younger to every 1,000 boys, according to the 2011 census, down from 927 a decade before. In G-South, a fast-changing area of new high-rises that house young professionals, 882 girls were born per 1,000 boys in the first 10 months of 2012, among the lowest ratios in the city.

In India, combating female feticide.

“It is certainly a worrying trend that this seems to be happening in affluent families,” said Manisha Mhaiskar, a deputy commissioner in Mumbai’s municipal council. “It is a cause for concern for both the national and the state” governments.

Indian sociologists say upwardly mobile families are eager to protect recently acquired wealth and enterprises, and daughters are seen as expensive in a country where dowries, though officially outlawed, remain widespread. After marriage, a bride typically moves in with her in-laws, and her inheritance in effect goes to her new family.

Medical advances — and a growing middle class with money to spend on them — also mean that well-off and educated urban couples have increasing access to ultrasounds that can identify sex and to abortion clinics. They also tend to want fewer children, a calculation that reduces their chances to have a boy, researchers say.

“Our elders think you must have a son. So [some women] think, ‘I must have one and make them happy.’ And it’s hard, because you don’t want to keep on producing children and have five or six children in today’s society,” said Rachana Zangda, 30, a business graduate who was also walking along the promenade. Both Zangda and Patil, who do not have children, said they would be equally happy to have a son or a daughter.

Ravinder Kaur, a Delhi-based sociologist who is studying the link between India’s rising incomes and widening sex ratios, said sex-selective abortions are most common among what she calls the emerging middle class, a group that has only recently emerged from poverty. As these families move into the “mature middle class” and grow more financially stable, they become more open to having daughters, she said.

But in the meantime, India’s increasingly skewed sex ratio could spur crimes such as bride-trafficking and sexual assault, as men struggle to find partners, Kaur said.

“There is an argument that scarce goods become highly valued. But actually you just get a competition that can become violent,” Kaur said.

India’s middle class thus encompasses two conflicting groups, experts say: young adults protesting for women’s rights and couples who secretly abort daughters.

“Within the same economic group you have people who are expressing anger, and we see high levels of sex-selection,” said Ranjana Kumari, the director of the Center for Social Research, a Delhi-based women’s rights group. “You have . . . the ‘conscious middle class’ and those who are yet to change.”

Some activists are trying to change attitudes to daughters among the upwardly mobile. Last fall, Kumari’s organization held “silent rallies,” with women and children standing wordlessly in Delhi malls and holding placards that displayed an area’s sex ratio. Population First, a Mumbai-based non­governmental organization, has established clubs that discuss sex-selective abortions in 20 of the city’s colleges. The group also gives presentations to advertisers about the images they project to the expanding consumer class.

In television commercials, “a family of four always has a boy and a girl, or two boys — never two girls,” said A.L. Sharada, the director of Population First.

Yet activists say they struggle to change the mind-set of educated couples, who tend to dislike preachy instructions and sometimes view sex-selection as part of a modern woman’s right to choose. Abortion in India is legal during the first 20 weeks of pregnancy in some situations.

Many government efforts to end sex-selection do not target the rising middle class. India has outlawed pregnant women from finding out the sex of their unborn babies, but couples with means can bribe doctors to disclose the information. Those with even greater resources travel outside the country, to places such as Dubai, for ultrasounds.

Under a pilot program launched by the Mumbai municipal council last year, nurses in public clinics counsel pregnant women and discourage them from sex-selection. But most middle-class Indians opt for private health care.

“Our interaction with [the affluent] in the aspect of health is limited,” said Mhaiskar, the Mumbai official.

Some women’s rights activists said they view last month’s rape case as a turning point.

“The people at the protests were a new generation. Most of them were below 25, so they have not made decisions about families yet,” Sharada said.

She said she expects that this cohort, armed with a greater awareness about crimes against women, will be less likely to shun daughters.

“They may be from the same economic class, but this age group is very different.”