(CNN) The House on Friday passed a massive defense policy bill that would launch a new "Space Corps" over the objections of the White House and the Pentagon.

The National Defense Authorization Act, a $696 billion measure that sets Pentagon policy and authorizes spending levels, easily cleared the House in a 344-81 vote.

Tucked in the bill is a proposal endorsed by House Armed Services Committee leaders to create a Space Corps as a new military branch under the umbrella of the Air Force.

Rep. Mike Rogers, the Strategic Forces Subcommittee chairman who proposed the idea, argued that the Air Force was prioritizing its fighter jets over space, and a dedicated service was needed to stay ahead of China and Russia in what many see as the next frontier of warfare.

But the idea was opposed by Pentagon leaders and the White House, who argued the idea was premature and needed more study.

Ohio Republican Rep. Mike Turner, a senior Armed Services member, proposed an amendment to strip the Space Corps provision from the bill, and Defense Secretary James Mattis took the rare step of writing a letter supporting Turner's amendment to remove it from the policy bill.

"It's unusual for us to write on an issue like that," Mattis told reporters Friday. "I don't want to say anymore right now. I leave that to Congress -- I made known what I think and now we'll leave it to Congress and their legislative role."

Turner also gathered the support of the heads of the House intelligence and House appropriations committees. But in the end, it was all for naught -- the House rules committee tossed his amendment out and blocked it from coming to the floor for a vote.

House Armed Services Chairman Mac Thornberry acknowledged the opposition in the Pentagon, but argued major reforms in the past often meet resistance from military leaders.

"If you look back at history, it is incumbent upon Congress to make changes in the Pentagon that they cannot make for themselves," Thornberry said, pointing to the creation of the Air Force itself.

Now, the Space Corps proposal will head to negotiations on a final defense policy bill with the Senate, which did not have a similar proposal in its bill.

While the House bill kept the Space Corps, the proposal would have been in a stronger position heading into the House-Senate negotiations had the amendment vote occurred to create the new military branch.

There were still plenty of other contentious amendment votes.

The House narrowly defeated a bid from GOP Rep. Vicky Hartzler of Missouri to block the Pentagon from funding gender reassignment surgeries for transgender service members. The 209-214 vote occurred after Mattis called Hartzler to try to urge her to withdraw her amendment, according to Pentagon and congressional officials.

The House also got into a contentious debate over Islam and an amendment from Republican Arizona Rep. Trent Franks to study "the use of violent or unorthodox Islamic religious doctrine to support extremist or terrorist messaging."

"Our allies across the world, including in the Muslim world, have now begun to study and understand the ideology that foments Islamic terrorism so they can begin to resist it on a strategic ideological level," Franks said. "If we in America do not also address this on a strategic level, this underlying ideology that catalyzes the evil of jihadist terrorism across the world, then its list of victims will only grow longer."

But Democrats slammed the amendment as an attempt to single out Islam that was unconstitutional and would feed into the narrative from ISIS that Islam is involved in a "clash of civilizations" with the West.

"You select one religion for particular scrutiny, to scrutinize their doctrine, to declare what's orthodox and unorthodox and identify teachers of it -- you have simply abridged the free exercise of that religion. That's unconstitutional," said Minnesota Democrat Rep. Keith Ellison, one of two Muslims in the House.

The amendment failed in 208-217 vote.

The House also defeated Republican amendments from Rep. Mike Conaway of Texas to block new Pentagon biofuels contracts, Rep. Tom McClintock of California to remove a ban on new base closures from the bill and Rep. Tom Rooney of Florida to strip a provision requiring athletes in the service academies to fulfill their active-duty service requirements before pursing pro sports.

The $696 billion policy bill that passed Friday is the first Republican salvo from defense hawks to try to boost the Pentagon budget and rebuild the military.

The bill includes $28 billion more in defense spending than the Trump administration requested, which GOP defense hawks said was insufficient.

The fight over the size of the defense budget is just getting started, however, as Senate Democrats have vowed to block major increases to defense spending without equal increases to domestic programs.

That fight will occur later this year over the defense appropriations bill, which is a separate piece of legislation that allocates spending for the Pentagon.

The defense budget as proposed by the House bill that passed Friday violates the 2011 Budget Control Act spending caps, which must be lifted or altered to give the military the level of funding the House is seeking.

That wasn't addressed in Friday's bill. But with the additional funding, the measure authorized an additional 17 F-35 fighters, eight F/A-18 Super Hornets and five more new ships than the Trump budget sought.

The bill also provided funding for an additional 17,000 Army soldiers, as well as a 2.4% pay raise for troops, higher than the Trump administration's request of 2.1%.