“I don’t support abortion for gender selection,” said Representative Diana DeGette, Democrat of Colorado and an opponent of the legislation. “I don’t know anyone who does. Maybe that’s because there is no problem in this country of abortion for gender selection.”

Abortion-rights advocates, while pleased with the outcome, slammed Representative Trent Franks, Republican of Arizona, for pushing forward with his bill, known as the Prenatal Nondiscrimination Act. “Many of the bill’s supporters have rejected equal pay for women and have tried to slash funding for programs that serve women and children,” said Nancy Keenan, president of Naral Pro-Choice America.

While there does not appear to be an extensive network of women seeking abortions in order to manage the race or gender makeup of their families, Mallory Quigley, a spokeswoman for the Susan B. Anthony List, an anti-abortion group, cited three studies that she said documented the use of sex-selective abortion, largely among a small number of women from various immigrant groups. “We’re confident there will be future votes and soon, on the issue,” Ms. Quigley said.

The abortion vote was just one issue on which the two parties engaged in political maneuvering on Thursday. Republicans and Democrats also continued to spar over how to deal with an impending increase in some student loan rates at the end of June. Facing an impasse, Congressional Republicans sent a letter to the White House offering some suggestions for how to pay for an extended lower loan rate.