Updated

The House of Representatives voted Thursday night to allow gays and lesbians to serve openly in the U.S. armed forces.

The vote repeals a 17-year-old law called "don't ask, don't tell." The policy permitted gays and lesbians to serve in the military, so long as they did not declare their sexual orientation. In exchange, the military brass would not inquire service members about their sexual preference.

"This is devastating to the war fighters and the combat infantrymen," said Rep. John Shimkus, R-Ill.

But many Democrats, like Rep. John Lewis, D-Ga., likened the policy to race discrimination.

"It didn't make sense then and it doesn't make sense now," said Lewis, a civil rights figure. "It is an affront to human dignity."

The military has discharged some 13,000 service members since the "don't ask, don't tell" policy went into effect.

Rep. Patrick Murphy, D-Penn., the first Iraq war veteran to serve in Congress, authored the House proposal.

Earlier Thursday, the Senate Armed Services Committee voted 16-12 to eliminate the old rule. Sen. Susan Collins, R-Maine, was the only Republican to vote in favor of repeal while Sen. Jim Webb, D-Va., was the only Democrat to vote against the initiative that was attached to a $760 billion defense spending bill.

"I'm excited. I can now join the military," mused Rep. Jared Polis, D-Colo., the first person to be openly gay and then elected to Congress.

The vote was 234 to 194.

Reps. Ileana Ros-Lehtinen, R-Fla., Ron Paul, R-Texas, Joseph Cao, R-La., and Charles Djou, R-Hawaii, were the only Republicans to vote in favor of scrapping the law.

The amendment was part of a broader bill to authorize Pentagon programs.

The House is expected to finish that measure Friday. Many House Republicans warned they'd vote against the entire bill if lawmakers repealed the ban on gays and lesbians serving openly.