WASHINGTON - The House last night delivered a victory to President Obama and gay-rights groups by approving a proposal to repeal the law that allows gays to serve in the military only if they don't disclose their sexual orientation.

The 234-194 vote to overturn the military's "don't ask, don't tell" policy reflected a view among many in Congress that America was ready for a military in which gays and straights can stand side-by-side in the trenches.

The amendment's chief sponsor was Bucks County Rep. Patrick Murphy, who served in the Iraq War. The Democrat said that when he was in Baghdad, "My teams did not care whether a fellow soldier was straight or gay if they could fire their assault rifle or run a convoy down ambush alley and do their job so everyone would come home safely."

Republicans, who voted overwhelmingly against it, cited statements by some military leaders that they needed more time to study how a change in the law could affect the lives and readiness of service members.

The House vote came just hours after the Senate Armed Services Committee took the same course and voted 16-12 in favor of repealing the 1993 law. In both cases the measure was offered as an amendment to a defense-spending bill.

Obama and leading Democrats had actively supported the repeal so that gays could serve in the military without fear of being exposed and discharged.

"This is the beginning of the end of a shameful ban on open service by lesbian and gay troops that has weakened our national security," Joe Solmonese, president of Human Rights Campaign, a leading gay-rights organization, said after the Senate panel's vote.

During an all-day House debate on the bill approving more than $700 billion in spending for defense programs, Republicans repeated statements by military- service chiefs that Congress should not act before the Pentagon completes a study on the impact of a repeal.

Congress going first "is the equivalent to turning to our men and women in uniform and their families and saying, 'Your opinion, your view, do not count,' " said Rep. Howard McKeon, of California, the top Republican on the House Armed Services Committee.

Democratic supporters stressed that the amendment was written so that the repeal would not take effect until after the Pentagon publishes in December the results of a survey on how service members and their families view the change, and until the president, the defense secretary and the Joint Chiefs of Staff certify that the repeal will not affect the military's ability to fight.

House Majority Leader Steny Hoyer, D-Md., said that of the 13,500 military members who have been discharged under "don't ask, don't tell," more than 1,000 filled critical occupations, such as engineers and interpreters.

He compared the arguments of the opposition to speeches in Congress in 1948, when lawmakers warned that integrating the troops would undermine morale in the military.

The drive to repeal the ban still faces a tough road in the full Senate, where Republicans are likely to filibuster it.

"I think it's really going to be very harmful to the morale and effectiveness of our military," said Sen. John McCain, of Arizona, the top Republican on the Armed Services Committee and a leading opponent of the repeal.

The Senate probably will take up the bill next month.

Defense Secretary Robert Gates has said he supports the repeal but would prefer that Congress wait for the December report.

Under "don't ask, don't tell," military leaders don't investigate a service member's sexual orientation as long as the person does not disclose that he or she is gay or has a same-sex relationship, which are grounds for dismissal.

Also yesterday, the House rejected an amendment to the defense bill that would have cut $485 million from the bill designated for a second engine for the new F-35 fighter jet.