WASHINGTON — The Senate has overwhelmingly approved a sweeping policy bill that would pump $700 billion into the military, putting the U.S. armed forces on track for a budget greater than at any time during the decade-plus wars in Iraq and Afghanistan.

Senators passed the legislation by a 89-8 vote Monday. The measure authorizes $700 billion in military spending for the fiscal year that begins Oct. 1, expands U.S. missile defenses in response to North Korea's growing hostility and refuses to allow excess military bases to be closed.

The 1,215-page measure defies a number of White House objections, but President Donald Trump hasn't threatened to veto the measure. The bill helps him honor a pledge to rebuild an American military that he said had become depleted on former President Barack Obama's watch.

Get Breaking News Delivered to Your Inbox

Sen. John McCain, R-Ariz., and other national security hawks have insisted the military branches are at risk of losing their edge in combat without a dramatic influx of money to repair shortfalls in training and equipment. Congress' failure to supply adequate budgets is at least partly responsible for a series of deadly ship collisions and helicopter crashes, according to McCain, the Armed Services Committee chairman.

McCain, who is battling an aggressive type of brain cancer, guided the bill toward passage as he railed against Washington gridlock and political gamesmanship. But he couldn't quell disputes among his colleagues over several contentious amendments that were blocked from votes and failed to be added to the bill.

Among them was a proposal by Sens. Kirsten Gillibrand, D-N.Y., and Susan Collins, R-Maine, that would have protected transgender service members from being kicked out of the armed forces. Gillibrand and McCain seek to achieve the same goal through separate legislation they introduced late last week. That bill also is supported by Jack Reed of Rhode Island, the top Democrat on the Armed Services panel.

Approved by the Armed Services Committee by a 27-0 vote in late June, the overall Senate bill provides $640 billion for core Pentagon operations, such as buying weapons and paying troops, and another $60 billion for wartime missions in Afghanistan, Iraq, Syria and elsewhere. Trump's budget request sought $603 billion for basic functions and $65 billion for overseas missions.

With North Korea's nuclear program a growing threat to the U.S. and its allies, the bill includes $8.5 billion to strengthen U.S. missile and defense systems. That's $630 million more than the Trump administration sought for those programs, according to a committee analysis.

North Korea last week conducted its longest-ever test flight of a ballistic missile, firing an intermediate-range weapon over U.S. ally Japan into the northern Pacific Ocean. The launch signaled both defiance of its rivals and a significant technological advance.

The legislation directs the Defense Department to deploy up to 14 additional ground-based interceptors at Fort Greely, Alaska, an increase that will expand to 58 the number of interceptors designed to destroy incoming warheads. The department also is tasked with finding a storage site for as many as 14 other spare interceptors, and senators envision an eventual arsenal of 100 with additional missile fields in the Midwest and on the East Coast.

The White House, in a statement issued earlier this month, called the order for more interceptors "premature" given the Pentagon's ongoing review of missile defense programs.

Despite the push for the additional billions in military spending, major hurdles need to be cleared before all the extra money materializes. Lawmakers will have to work out a deal that lifts the caps on federal agency budgets, including the Pentagon's, mandated by a 2011 law. Congress has passed temporary relief from the limits before, but senior military officials have urged for the law to be repealed altogether.

As their House counterparts did, the Senate bill rejects Defense Secretary Jim Mattis' plan to launch a new round of base closings starting in 2021. He told lawmakers in June that closing excess installations would save $10 billion over a five-year period. Mattis said the savings could be used to acquire four nuclear submarines or dozens of jet fighters. But military installations are prized possessions in states and lawmakers refused to go along.

The bill allots $10.6 billion for 94 Joint Strike Fighter aircraft, which is two dozen more than Trump requested. The bill also provides $25 billion to pay for 13 ships, which is $5 billion and five ships more than the Trump sought.