WASHINGTON >> The massive $118 billion Senate border bill not only contains once-in-a-decade border security legislation and wartime aid to Israel and Ukraine, but also offers a chance for the U.S. to keep its promise to Afghans who worked alongside U.S. soldiers in America’s longest war.

Tucked inside the sprawling package is a measure that would provide a long-awaited pathway to residency for tens of thousands of Afghan refugees who arrived in the U.S. on military planes after the chaotic withdrawal from Afghanistan in August 2021.

But the measure may fail if members can’t agree on the bill’s larger, unrelated provisions. Democrats, especially members of the Congressional Hispanic Caucus, have voiced opposition for what they call the extreme, far-right border policies in the legislation that they say do nothing to help fix the country’s broken immigration system.

Conservatives have said the package does not go far enough in limiting the number of daily migrant crossings at the southern border.

If it fails, it will represent yet another disappointment for the more than 76,000 Afghans currently living in the U.S. who remain in immigration limbo as a result of years of congressional inaction.

A small group of bipartisan lawmakers and advocacy groups have worked for nearly three years to get a House or Senate vote on a standalone bill, the Afghan Adjustment Act, that would prevent Afghans from becoming stranded without legal residency status when their humanitarian parole expires. But advocates have repeatedly faced strong opposition from some Republican lawmakers to vetting requirements for the refugees who were brought here and their family members still stranded in Kabul.

The bipartisan border deal offered long-awaited breakthrough. Both Republican and Democratic senators and their staff worked to bridge the divide and produce legislative text that both sides could support. The new proposal would couple measures enabling qualified Afghans to eventually apply for U.S. citizenship, as was done for refugees in the past, including those from Cuba, Vietnam and Iraq, with stricter and more expedited vetting processes.

“I think the most gracious thing would be to say there’s been a lot of twists and turns, but I’m very happy with the result,” Democratic Sen. Chris Coons of Delaware, one of the lead sponsors of the effort, told The Associated Press on Monday. “And I’m very glad that it’s included because this is an important signal that the United States stands by those who stand by us.”