Stung by a Senate setback on gay marriage (search), Republicans passed legislation in the House Thursday to prevent federal courts from ordering states to recognize same-sex unions sanctioned elsewhere.

Democrats called the bill an unconstitutional attack on gays and the federal judiciary, and said its passage was just a matter of election-year politics.

A day before Congress closes down for six weeks, the 233-194, mainly party-line vote handed at least a symbolic victory to social conservatives who form a key Republican constituency. The bill has the strong backing of the Bush administration, but is not expected to make headway in the Senate, aides to Democrats and Republicans said.

Last week, the Senate failed to advance a constitutional amendment banning gay marriage.

Supporters said the House legislation would protect the institution of marriage by reining in federal judges who might otherwise impose gay marriage on states that have banned it. "Marriage is under attack," said Rep. James Sensenbrenner (search), R-Wis., referring to the Massachusetts state court decision allowing same-sex marriages.

The bill would strip the Supreme Court and other federal courts of their jurisdiction to rule on challenges to state bans on gay marriages under a provision of the 1996 federal Defense of Marriage Act (search). That law defines marriage as between a man and a woman, and says states are not compelled to recognize gay marriages that take place in other states.

The nonpartisan Congressional Research Service said it could find no precedent for Congress passing a law to limit federal courts from ruling on the constitutionality of another law, although Democrats said opponents of civil rights legislation tried to do the same thing.

The effect of the bill would be to single out gays and lesbians, barring them from going into federal court to seek to have their marriages recognized, several Democrats said. Civil rights groups said the bill is unconstitutional for that reason.

"We face no less than a sign on the courthouse door: 'You may not defend your constitutional rights in this court. You may not seek equal protection here,"' said Rep. Tammy Baldwin (search), D-Wis., the House's lone declared lesbian. "Today, the 'you' is gay and lesbian citizens. But who would be next?"

Some Republican opponents of the legislation also said they wanted to avoid setting a precedent that could used by a Congress controlled by Democrats to satisfy their allies or by lawmakers who wanted to shield future unconstitutional legislation from federal court review.

Cheryl Jacques, president of the Human Rights Campaign, which opposed the legislation, said GOP congressional leaders continue to stay on the issue of gay marriage because of election-year politics. "On a day when Congress was told to focus on terrorism, it is a shame that they instead focused on discrimination," Jacques said, referring to Thursday's release of the final report of the Sept. 11 Commission.

But a parade of conservative Republican speakers lamented the unbridled power of federal judges to thwart majority will, although no federal court has yet ruled on the 1996 law.

"Judicial activism has reached a crisis," said Rep. Lamar Smith, R-Texas.

No one suggested that Thursday's vote was the last word on the issue.

Tony Perkins of the Family Research Council said the legislation is a welcome interim step. "It provides us the opportunity to isolate some of these judicial rewrites of marriage. Until we can get an amendment to the Constitution, this will keep it from spreading," Perkins said.

Addressing Democrats, House Majority Leader Tom DeLay summed up the arguments on both sides at the start of the debate. "You think this bill is cruel and we think same-sex marriage is a contradiction in terms," DeLay, R-Texas, said.