Andrew Harnik / AP

Congress crammed something for just about everyone into the $1.3 trillion spending package unveiled on Wednesday—more money for the military, border security, the opioid epidemic, infrastructure, student loans, election security, and even a few modest measures to prevent gun violence.

But lawmakers whiffed on striking agreements on two of their biggest priorities of the last six months: stabilizing the individual health insurance markets under the Affordable Care Act and resolving the status of young undocumented immigrants protected under the Deferred Action for Childhood Arrivals program. Negotiations over both issues broke down in the final days leading up to a March 23 deadline for funding the government. And given the likelihood that the omnibus spending bill will be the last major piece of legislation enacted before the midterm campaign heats up, Congress may have missed its best chance to act either on DACA or Obamacare before the November election.

The lack of a DACA fix stung Democrats in particular, who had promised immigrant activists that as part of the spending fight they would secure an extension of protections for immigrants brought into the U.S. illegally as children after President Trump announced last fall he would end the Obama-era program in March. But a trio of factors drained the party of the leverage it once had on immigration. First, Democratic leaders had to retreat barely 48 hours into a government shutdown they caused in January over the lack of a DACA bill. Then, a federal judge ordered the Trump administration to continue accepting two-year renewals for DACA, essentially negating the March 5 deadline that Congress was trying to meet. Finally, bipartisan proposals to offer a path to citizenship for so-called Dreamers in exchange for enhanced border security fizzled in the Senate once the Trump administration urged Republicans to oppose them.

Despite those setbacks, there was brief hope this week that congressional leaders and the White House would reach a last-minute DACA deal that could be inserted into the $1.3 trillion spending deal moving through the Capitol. According to a senior Democratic aide, the two parties exchanged a pair of proposals over the last several days. Republicans initially proposed a three-year extension of protected status for around 700,000 DACA recipients if Democrats would agree to Trump’s full request of $25 billion in funding for his southern border wall. Democrats rejected that and said they would give Trump his $25 billion in exchange for a path to citizenship for 1.8 million Dreamers—essentially the same deal that Senate Minority Leader Chuck Schumer had offered Trump hours before the government shut down in January.

Republicans came back with another offer: three years of DACA protections for three years of border-wall funding. But Democrats stuck to their demand for a path to citizenship for the broader population of 1.8 million, and the talks broke down.

“That was a disappointment,” House Minority Leader Nancy Pelosi told reporters on Thursday, even as she hailed the spending bill as an overall victory for Democrats. She said it was now up to Speaker Paul Ryan to keep a commitment he made to put a DACA bill on the floor. “We still call upon the speaker: honor your own pledge,” Pelosi said. “Honor your own words. Give us a chance to vote on the Dream Act.” A Ryan spokeswoman did not respond to a request for comment.

The failure to strike a deal on Obamacare was frustrating to negotiators in both parties, and it resulted from a fight over abortion. As with DACA, it was a move by Trump that forced Congress’s hand in the first place. The president last fall began withholding federal payments to insurance companies under Obamacare reimbursing them for subsidies that consumers receive when buying health insurance. Without the payments, known as cost-sharing reductions, insurers were under pressure to raise premiums even further. Democrats feared a destabilization of Obamacare’s insurance markets, while Republicans were worried that voters would blame them for rising prices under their watch.

With the legality of the payments subject to a court battle, Senators Lamar Alexander of Tennessee and Patty Murray of Washington state agreed to legislation authorizing them for two years, along with other provisions designed to lower insurance premiums. The bill faced opposition from conservatives who viewed it as propping up Obamacare. But Senator Susan Collins of Maine, a top backer of the bill and her own proposal for a reinsurance program to help lower out-of-pocket costs, demanded a vote on the Obamacare package in exchange for her support for the GOP’s tax overhaul in December—a bill that passed on a party-line majority.

After Republican leaders ignored the bill in earlier spending fights, it looked like Collins might finally get her vote as part of the omnibus. But top Republicans made an additional demand that the longstanding prohibition on federal funding of abortion—known as the Hyde Amendment—be extended to include any insurance plan purchased using Obamacare subsidies. Democrats balked. “This is a change to the current status quo and would have the effect of ending abortion coverage on the individual private market. That is their goal,” Pelosi spokesman Drew Hammill told me. Democrats also objected to a provision Republicans added that would have allowed states to regulate short-term insurance plans that didn’t comply with Obamacare’s consumer protections.

With conservatives opposed to the bill, it would be unable to pass the House without Democratic support. So Ryan and Senate Majority Leader Mitch McConnell kept it out of the broader spending package, angering its Republican backers. “It is extremely disappointing that Speaker Ryan chose not to include our health insurance legislation in the government funding bill due to opposition from Leader Pelosi,” Collins tweeted Wednesday night after the legislation was released. She warned that Congress was missing its last, best chance to act: “The Omnibus is the last opportunity to prevent these rate increases from taking effect and to help stabilize the market.”

Other Republicans insinuated that the Democratic opposition was about more than abortion politics. “This is a phony excuse,” Alexander said. While for months it was Democrats demanding that Congress act to prevent Trump from cutting off the subsidy payments to insurers and “sabotaging” Obamacare, his decision to do so had an unexpected outcome: It triggered more generous subsidies for many plans after insurers increased priced, and that cost was borne directly by the government. Restoring the payments to insurers could thus increase costs for some consumers while reducing them for others.

And with Democrats anticipating a strong midterm election, they are more confident that voters who do see their premiums go up will blame Republicans. “I’ve never been more disappointed in my Democratic colleagues of sitting on the sidelines and watching hard-working Americans pay a price in premiums cause they’re trying to win a political argument,” Senator Lindsey Graham of South Carolina said on Wednesday. “This is phony, I hope you lose votes, I hope you lose seats. You’re not worthy of governing this place.”

Democrats dismissed the suggestion. “I know many Republicans have said this is the end of the road for bipartisan negotiations on health care—but if it is, that’s only because they have chosen that route,” Murray said in a Senate floor speech on Thursday.

But whether overtly or not, Democrats’ improved standing ahead of the 2018 campaign may be causing them to drive a harder bargain with Republicans both on immigration and health care. It’s a considerable risk. While a majority in the House or Senate will give Democrats far greater leverage to fight for the Dreamers and Obamacare in 2019, falling short in November could cause them to regret the offers they’re leaving on the table now.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.