WASHINGTON ― The Senate on Thursday failed to advance a defense spending bill for 2020 amid partisan fighting over the president’s use of military funding for the border wall.

The package of spending for the Department of Defense and for the departments of Labor and Health and Human Services failed on a procedural vote, as most Democrats withheld their support. The vote was 51-41, which fell short of the 60 votes needed.

There was progress earlier Thursday when the Senate voted 84-9 to pass a package of fiscal 2020 domestic spending bills passed by the House. The package included measures for the Appropriations Subcommittees on Commerce, Justice, Science, and Related Agencies; Agriculture, Rural Development, Food and Drug Administration, and Related Agencies; Interior, Environment, and Related Agencies; and Transportation, Housing and Urban Development, and Related Agencies.

Closed-door budget talks have showed signs of a thaw. On Tuesday, top aides to House and Senate appropriators, leadership from both parties, and White House officials met to find common ground on various policy issues, including the border wall and spending allocations for individual bills, called 302(b)s ― which are essentially the details beyond the larger bipartisan, two-year, $2.7 trillion budget deal Congress reached in July.

“We’re talking seriously about the 302(b)s, and that’s a renewed conversation,” said Senate Appropriations Committee Chairman Richard Shelby, R-Ala. “We’re talking now and we made that step today, but that is a step."

Shelby said he is also having ad hoc conversations with key Democrats to resolve smaller policy issues.

Because Senate Majority Leader Mitch McConnell, R-Ky., held the vote on the areas of defense, labor, and health and human services ahead of a larger bipartisan agreement, Republicans were able to rhetorically blast Democrats, accusing them of being too consumed with the presidential impeachment inquiry to fund the military.

“Washington Democrats have talked up a storm in recent days, criticizing the Trump administration’s approach to Syria and the Middle East. Lots of talk," McConnell said in a Senate floor speech.

“But apparently they are not concerned enough about the Middle East and fighting ISIS to actually vote for the funding that keeps those missions going,” he added, using an acronym for the Islamic State group.

The Senate Appropriations Committee’s top Democrat, Sen. Patrick Leahy, said Democrats would oppose the bill because it shortchanges domestic programs and shifts bills in defense spending away from military construction projects to President Donald Trump’s southern border wall initiative.

“We oppose this bill because we are fighting to protect funding for the men and women in uniform,” said Leahy of Vermont, calling Trump’s effort to shift funds a “short-sighted cash grab.”

Senate Minority Leader Chuck Schumer, D-N.Y., warned that Trump’s insistence on wall funding led to last year’s record government shutdown. He exhorted McConnell to stop distorting Democrats’ positions and engage in serious, bipartisan talks.

“Instead of this bunk, Leader McConnell, my Republican friends, roll up your sleeves and work with us and get something done,” Schumer said. “As is clear, the bills we are voting on where there's agreement, we can move forward.”

With talks dragging and the likelihood that impeachment proceedings against Trump will dominate congressional business, lawmakers acknowledged they will likely need a stopgap spending measure that extends after the last funding patch expires Nov. 21, to avoid a government shutdown. Whether the patch will extend until the end of the calendar year or into February or March is under discussion.

Shelby was unable to say Thursday whether Congress can manage both impeachment proceedings and pass the spending bills.

“It would be a wonderful thing to do, do all of our approps, do all of that. The question is will it be done,” Shelby said.

The Senate’s No. 2 Republican, Sen. John Thune, of South Dakota, told reporters Thursday that the linchpin to a larger deal is an agreement on funding allocations and that reaching such a deal before Nov. 21 “is probably aspirational at this point.”

Thune expressed hope that impeachment proceedings would not further stall the appropriations process. “We’re hoping that in light of everything else that’s happening that we get a budget deal that gets [defense appropriations] across the finish line,” he said.