WASHINGTON — Wading into the gay marriage debate, the Republican-led House tacked a provision banning same-sex marriages at military chapels onto a sweeping defense bill that is now headed to the Senate.

Despite the high-octane public discussion over gay marriage that has intensified since President Obama announced his support for same-sex marriages, the issue has been one that Capitol Hill has largely sought to avoid. But the GOP majority led Congress into the issue by adding the same-sex marriage prohibitions to the defense bill.

The annual National Defense Authorization Act, approved 299 to 120 on Friday, is a traditionally bipartisan effort that can prove difficult for lawmakers to oppose. The bill includes a 1.7% annual pay raise for the troops but also is loaded with politically charged extras.

In passing the $642-billion measure, lawmakers broke the budget agreement Congress made last summer with the Obama administration — beefing up military spending $8 billion beyond the agreed-upon limit. The White House threatened a veto.

Intense debate surrounded a bipartisan amendment to prevent the indefinite detention of terrorism suspects, including U.S. citizens or those captured or detained in the U.S. It was rejected. Instead, the House agreed to prohibit the transfer of military detainees from the facility at Guantanamo Bay, Cuba, to the U.S., and approved a provision reaffirming that all detainees have the right to a trial.

The bill addresses gay marriage with two provisions. One would ban performing gay marriages on any facility owned by the military. Another would protect military chaplains from punishment if they declined to marry a gay couple.

The Department of Defense had opened the door to gay weddings on bases in a memo last September after Congress repealed the “don’t ask, don’t tell” policy, which barred gays from openly serving in the military. The policy change said chaplains were allowed to perform same-sex marriages but noted they could not be required to. It is not clear whether any ceremonies have yet been performed in military chapels.

“Liberals may have successfully ended ‘don’t ask, don’t tell,’ but they should not be allowed to force members of our military to give up their religious beliefs,” Rep. Todd Akin (R-Mo.), who wrote one of the gay marriage provisions, said in a statement. “That is simply unacceptable and unconstitutional.”

The Pentagon memos noted that the ceremonies must not be prohibited by “applicable state and local law.” Gay rights activists argued that does not prevent a base in a state that does not recognize same-sex marriages from being used to hold a ceremony if the license is obtained in a state that does allow it. Same-sex marriages are not honored across all state lines.

But the defense bill could halt that process, and now says bases “may not be used to officiate, solemnize, a marriage, or marriage-like ceremony” that is not between a man and a woman.

The Obama administration called the provisions “troublesome and potentially unconstitutional."Rep. Adam Smith(D-Wash.), the top Democrat on the Armed Services Committee, called it an attack on gay service members.

Gay rights groups said they were monitoring the defense bill closely, and expected that the Senate, where Democrats have the majority, would not allow the gay marriage restrictions to stand.

The House worked into the early morning hours this week on the bill, which sets broad military policy for the year. The legislation authorizes the nation’s weapons systems, including a new ground-based military defense system for the East Coast.

The detainee issue exposed continued divisions within the GOP on civil libertarian issues. Nineteen Republicans, largely tea-party-aligned freshmen and veteran conservatives, joined Democrats in the unsuccessful attempt to ensure terrorism suspects are not indefinitely held.

ian.duncan@latimes.com

lisa.mascaro@latimes.com