US lawmakers took the first step Friday in approving the annual Pentagon budget in a vote that came down to the wire after Republicans added a raft of hardline "culture war" measures to the legislation.

The National Defense Authorization Act green-lights $886 billion President Joe Biden requested for 2024 defense programs, giving troops a 5.2 percent pay hike, providing $300 million in aid to Ukraine and paying for nine new navy ships.

But almost every Democrat in the House of Representatives opposed the normally uncontroversial legislation, after conservatives added provisions rolling back diversity programs and ending funding for abortion and transgender medical care.

"What was once an example of compromise and functioning government has become an ode to bigotry and ignorance," a group of senior Democrats led by Adam Smith, the party's top lawmaker on the armed services committee, said in a blistering statement.

Republican House Speaker Kevin McCarthy needed near-unanimous support in his narrow, five-seat majority, to muscle through the more than 1,200-page package on a 219-210 vote.

He had bowed to pressure from the far right to add hardline provisions that will almost certainly be dropped in negotiations with the Democratic-led Senate, which begins debating its version of the legislation next week.

Republicans pushed through amendments gutting Pentagon diversity, equity and inclusion programs, banning the pro-LGBT pride flag at military bases, and ending funding for transgender-related medical services.

As is often the case in modern Washington, the polarizing issue of abortion access also proved a key sticking point.

Former White House physician Ronny Jackson, now a hardline right-wing lawmaker, introduced a provision banning the Defense Department from covering travel expenses for service members needing to cross state lines to get an abortion.

"These servicewomen leave their homes, their families and friends, and are willing to risk their lives to serve our nation," Lois Frankel, the chairwoman of the Democratic Women's Caucus, said in a statement.

"And yet House Republicans are adamant on ripping away their reproductive freedom, and undoing a policy that would ensure they can travel to get abortion care. It's absolutely shameful."

The issue has become a major concern in the Pentagon, as Senator Tommy Tuberville -- a far right Republican -- is blocking more than 250 military promotions and nominations until the department scraps the policy.

The Marine Corps has been left without a confirmed leader for the first time in 164 years as a result, and Defense Secretary Lloyd Austin said Thursday that Tuberville's protest, now in its fifth month, was a "national security issue."