The House passed a finalized version of the $768 billion defense authorization bill late Tuesday night with overwhelming bipartisan support, moving legislation hamstrung by delays, amendment fights and political discord one step closer to becoming law before the end of the year.

The legislation directs an independent review of the Afghanistan war’s legacy and errors, and establishes a new means for the military to prosecute sexual assault and related crimes, according to a final draft released hours before the House passed it by a vote of 363 to 70.

But several key policy provisions that had won clear majority support in Congress — including to more broadly change the military justice system, require women to register with Selective Service and repeal the Iraq War authorization — were discarded as lawmakers in the House and Senate raced to strike a compromise on the measure that dictates funding for the Pentagon and other defense operations in the year ahead. Their omission caused an uproar among some lawmakers, even as others cheered the legislation as comprehensive and historic.

The bill next heads to the Senate, where it is expected to pass and move on to the White House for President Biden’s approval.

In a break with common practice, this year’s final bill was cobbled together behind closed doors by the leaders of the House and Senate Armed Services committees before the full Senate, stymied by scheduling delays and a dispute over amendments, was able to vote on its version of the legislation.

While the push to scrutinize the nation’s 20-year campaign in Afghanistan, driven largely by the haphazard evacuation from Kabul earlier this year, generated broad bipartisan support in both chambers, the rushed approach to fuse the House and Senate versions of the bill has drawn protests from several groups of lawmakers — particularly those hoping it would take bolder steps to change the military’s culture and make it a more equitable environment for women and minorities.

“It is an unconscionable failure to deliver a National Defense Authorization Act that does not meet the values of equity and justice for which we have long strived or a bill that does not meaningfully protect the foundations of our democracy,” Rep. Anthony G. Brown (D-Md.) wrote in a letter to fellow members of the Congressional Black Caucus, urging them to oppose the bill when it came to the House floor. Brown, who served in the Army for 30 years before joining Congress, had been a key force behind efforts to more broadly overhaul military justice and combat extremism in the ranks. Both provisions were left out.

“Supporting our troops does not require us to pass the NDAA simply because it includes important provisions such as annual pay raise,” Brown added. “It must also protect the Black men and women who are disproportionately the target of extremism and a biased military justice system.”

One of the most striking provisions removed from the legislation was a requirement that women begin to register with the Selective Service System, which coordinates the military draft should there be a need to supplement voluntary forces. Though there has not been a draft since 1973, including women was touted as a necessary and largely noncontroversial change to acknowledge the increased parity between female and male service members.

But the provision was a pet peeve of Sen. James M. Inhofe (Okla.), the top Republican on the Senate Armed Services Committee, who took credit Tuesday for excising it from the defense bill.

“I’m proud to have successfully removed this provision from the final agreement,” Inhofe said in a statement. “Plain and simple, we shouldn’t be forcing our daughters and granddaughters to register for the Selective Service.”

Issues that disproportionately affect female service members were at the heart of several of the most high-profile issues debated as part of this year’s defense bill. The bill creates a special victims prosecutor with the ability to determine when charges ought to be filed in cases of sexual assault and related crimes, murder, kidnapping and child pornography. The legislation also guarantees 12 weeks of parental leave for all service members.

But congressional negotiators eschewed a push to mandate a broader roster of changes to the military justice system that had the support of a majority of both chambers — and, supporters argue, would have helped end discrimination of various forms, and provide better guarantees of justice for crime victims.

The rejected proposal from Sen. Kirsten Gillibrand (D-N.Y.) would have put all crimes carrying a maximum jail term of a year or more under the purview of the special victims prosecutor, and put the authority to convene courts-martial in the hands of an independent authority as well. Many supporters of that plan are concerned that commanders — even if obligated to follow the “binding” direction from a special victims prosecutor to convene a trial — could create other obstacles to justice, by retaining the right to select the jury or by prematurely dismissing charges.

The bill does not contain a repeal of the authorization for use of military force that Congress passed in 2002 to enable the war in Iraq, despite that provision having passed the House and a key Senate committee earlier this year. Sen. Tim Kaine (D-Va.), its chief architect, had hoped to present it as an amendment to the annual defense authorization bill.

The bill also stops short of expanding the restrictions on the United States’ military cooperation with Saudi Arabia over its involvement in Yemen’s civil war, or establishing new sanctions against the kingdom over its human rights abuses, including the 2018 killing of Washington Post contributing columnist Jamal Khashoggi. Both items had been contemplated in the House-passed version of the defense bill.

Yet the measure does demand scrutiny of the Defense Department in some key areas. With respect to future threats, it instructs the Pentagon to report to Congress about the testing and development of hypersonic capabilities — a particular area of concern since China successfully tested a nuclear-capable hypersonic missile earlier this year. The bill commissions a classified report outlining the United States’ “grand strategy” for China, and states that U.S. policy regarding Taiwan is “to maintain the capacity … to resist a fait accompli” that would jeopardize its security.

It also directs an increase of $50 million in military assistance for Ukraine, which faces renewed threats from a massive mobilization of Russian troops near its eastern border.

The legislation orders the study of less-defined threats, too, including requirements that the Pentagon and intelligence community scrutinize unidentified aerial phenomena — commonly referred to as UFOs — and report to Congress what it learns. It nods to the pattern of mysterious debilitating incidents targeting U.S. diplomats and intelligence officials overseas, colloquially known as the “Havana syndrome,” by directing Defense Secretary Lloyd Austin to create a “cross-functional team to address national security challenges posed anomalous health incidents.”

The 16-member commission that will review the Afghanistan war will be selected by congressional leaders, and the chairs and ranking minority-party members of the House and Senate committees responsible for the armed services, foreign affairs and intelligence, each of whom will have the right to appoint one commissioner, the legislation says.