WASHINGTON — In a rare act of bipartisanship on Capitol Hill, the Senate passed a $700 billion defense policy bill on Monday that sets forth a muscular vision of America as a global power, with a Pentagon budget that far exceeds what President Trump has asked for.

Senators voted 89-9 to approve the measure, known as the National Defense Authorization Act; the House has already adopted a similar version.

The vote marked the 56th consecutive year that Congress has passed the defense policy bill — a point of personal pride for Senator John McCain, the Arizona Republican who chairs the Senate Armed Services Committee, and who has spent the past week shepherding the bill on the Senate floor as he battles brain cancer.

In arguing for the increased funding, Mr. McCain cited a string of recent deadly accidents involving the military, including a collision last month between an oil tanker and the destroyer John S. McCain, named for the senator’s father and grandfather. Ten sailors were killed and five others injured.