WASHINGTON — The U.S. Senate had a shot at partially repealing the much-maligned budget caps, but it slipped through lawmakers’ fingers Thursday.

Behind the scenes Wednesday and Thursday, Senate Republicans and Democrats wrangled in vain over opposing packages of amendments to the 2018 defense authorization bill — including one that would have partially repealed sequestration, the enforcement mechanism for budget caps on the defense and non-defense sides of the budget.

After they could not reach an agreement, the Senate voted 84-9 to close debate without votes on several controversial, hotly anticipated amendments, including protections for transgender troops and to initiate a round of closures for excess military installations.

The breakdown occurred over four other amendments Republican leaders offered to Democrats, including the sequestration repeal, from Sen. Tom Cotton, R-Ark.; one to prohibit indefinite detention of terrorism suspects from Sen. Mike Lee, R-Utah; one to protect the defense supply chain from foreign goods from Sen. Tammy Baldwin, D-Wis., and one to protect defense medical research programs, from Sen. Dick Durbin, D-Ill.

“It really came down to about four amendments that we could never get agreement to move forward on,” said Senate Armed Services Committee Chairman John McCain, R-Ariz.

To allow amendments to be considered requires unanimous consent and when one senator objects, it can block them all.

The 2011 Budget Control Act caps have become a symbol of Washington dysfunction and the bane of the military and defense hawks whose ambitions for raising the Defense Department budget mean grappling with the caps every year.

Surpassing the budget caps triggers an automatic across-the-board budget cut known as sequestration.

To be clear, if the Senate were to pass a budget cap or sequestration repeal, the odds of it passing in the House would be slim due to Republican opposition. While caps for defense are unpopular, fiscal conservatives favor limits on nondefense spending.

Democrats’ stated reason for their opposition to Cotton’s measure is that it leaves sequestration in place for mandatory spending, also known as direct spending or entitlement spending.

“He does not include mandatory spending,” said Durbin, the Senate’s No. 2 Democrat and ranking member on the Senate Appropriations defense subcommittee. “He ends sequestration for defense and nondefense but leaves the whole world of entitlements and mandatory programs still subject.”

But Republicans privately argue that this objection is disingenuous because the impact of caps on mandatory spending is extremely limited. Social Security and Medicaid are among many programs that would remain intact under Cotton’s proposal, they said.

Republicans also note that Democrats have voted three times, by wide margins, to extend mandatory caps, which now expire in 2025.

Democrats have another reason. The caps and sequestration give them crucial leverage in budget negotiations to extract deals from GOP leaders to increase the nondefense side of the budget by roughly the same amount as the defense side.

Republicans have a slim majority in the Senate, where easing the caps would take 60 votes. But divisions within the GOP in recent years have forced its leadership to work with Democrats to get the votes needed to pass federal budgets.

“It would take away any incentive to have some balance between domestic and military spending,” said Patrick Leahy, D-Vt., vice chairman of the Senate Appropriations Committee and lead Democratic negotiator on the last budget deal. “You might as well say, ‘Let’s give a dollar to domestic and all the rest to the military.’”