The Senate on Wednesday overwhelmingly passed an $886 billion defense bill that would set Pentagon policy and provide a 5.2 percent pay raise for military personnel, defying the demands of Republicans who failed to attach a raft of deeply partisan restrictions on abortion, transgender care and diversity initiatives.

The vote was 87 to 13 to approve the legislation, which would expand the Defense Department’s ability to compete with China and Russia in hypersonic and nuclear weapons. It would also direct hundreds of millions of dollars in military assistance to Ukraine and Israel.

The Ukraine and Israel programs authorized by the bill are distinct from a $111 billion spending bill to send additional weapons to those countries, among other expenditures, that is currently stalled in Congress.

The defense bill would also extend into 2025 a program that allows the intelligence community to conduct warrantless surveillance of foreign individuals outside the United States. The program has come under fire because of how the F.B.I. has handled the private messages of Americans.