Updated

The House of Representatives overwhelmingly passed on Friday a $649 billion defense spending bill that boosts the Pentagon budget by $17 billion and covers the costs of wars in Iraq and Afghanistan.

The strong bipartisan vote was 336-87 and reflected lawmakers' intent to ensure national security, preserve defense jobs across the nation and avoid deep cuts while the country is at war.

While House Republican leaders slashed billions from all other government agencies, the Defense Department is the only one that will see a double-digit increase in its budget beginning Oct. 1.

Amid negotiations to cut spending and raise the nation's borrowing limit, the House rejected several amendments to cut the Pentagon budget, including a measure by Democratic Rep. Barney Frank to halve the bill's increase in defense spending.

"We are at a time of austerity. We are at a time when the important programs, valid programs, are being cut back," Frank said.

He scoffed at the suggestion by congressional leaders that "everything is on the table" in budget negotiations with the Obama administration, Frank said, "The military budget is not on the table. The military is at the table, and it is eating everybody else's lunch."

Still, the overall bill is $9 billion less than President Barack Obama had sought. The White House has threatened a veto, citing limits on the president's authority to transfer detainees from the U.S. prison at Guantanamo Bay, Cuba, and money for defense programs it did not want.

The measure includes $119 billion for the wars in Iraq and Afghanistan.

The House also voted to slow repeal of the policy allowing gays to serve openly in the military, backing an amendment to block funds for the training manual for the Chaplain Corps on ending the so-called "don't ask, don't tell" policy.

Republican Rep. Tim Huelskamp, sponsor of the amendment, said its purpose was to prohibit chaplains from performing same-sex marriages on Navy bases regardless of a state's law. The House approved the measure 236-184.

The overall bill must be reconciled with a still-to-be-completed Senate version.

The final vote came after the House turned back an amendment by Democratic Rep. Dennis Kucinich of Ohio that would have barred funds for the U.S. operation against Libya. The vote was 251-169.

The House has sent mixed signals on Obama's military action against Libya, voting to prohibit weapons and training to rebels looking to oust Moammar Gadhafi but stopping short of trying to cut off money for American participation in the NATO-led mission.

In a series of votes Thursday, Republicans and Democrats expressed their dissatisfaction with the Libya operation, now in its fourth month with no end in sight and waning support from some nations in the international coalition. The House voted to bar military aid to the rebels but moments later rejected efforts to prevent funding for the limited U.S. mission.

The votes mirrored the contradictory actions of the House last month, when lawmakers refused to approve the operation but declined to cut off the money.

The congressional unrest over Libya stems from a stalemated civil war and Obama's contention that he did not need congressional authorization to engage in another war on top of Afghanistan and Iraq because Libya fighting does not amount to full-blown hostilities. Among war-weary NATO allies, Italy announced that it was reducing its participation in the campaign by removing an aircraft carrier from the region and pulling thousands of troops home.

"Libya did not attack us. Libya did not attack NATO," Rep. Tom Cole, R-Okla., said. "However much we detest Mr. Gadhafi and his regime, we have no reason to be at war."

The House voted 225-201 for an amendment sponsored by Cole to bar the Pentagon from providing "military equipment, training or advice or other support for military activities" to an outside group, such as rebel forces, for military action in or against Libya.

Forty-eight Democrats backed the Republican-sponsored measure.