WASHINGTON — U.S. lawmakers on Thursday averted a government shutdown this week by passing a new funding extension to keep federal operations running for two more weeks, in the hopes of reaching a broader budget consensus before Christmas.

The measure, which passed mostly along party lines in the House (235-193) and with little debate in the Senate (81-14), ensures that Defense Department operations and other federal programs won’t be disrupted this weekend. A previous continuing resolution on the budget was set to expire Friday night, forcing the short-term legislative action.

Senate Armed Services Committee Chair John McCain was a notable “no.” McCain, R-Ariz., has railed against stopgap funding, and budget instability more broadly, for wreaking havoc on the military.

“Every day we spend on a Continuing Resolution is a day that our military must try to do more with less, modernization is delayed, and readiness is degraded,” he said in a statement.

Now the question for lawmakers is whether they can reach a deal on appropriations for all of fiscal 2018 — which began on Oct. 1 — or whether they’ll have to scramble another short-term funding patch over the next 15 days.

“There’s still a lot of work to be done,” said Pennsylvania Republican Rep. Charlie Dent, chair of the House Appropriations Subcommittee on Military Construction and Veterans Affairs and co-chair of the moderate Tuesday Group. “We have to reach a budget agreement, we have to pass a second CR taking us into the new year — and accidents can happen.”

For months, budget negotiations between Republicans and Democrats have been stalled by disagreements over spending caps, immigration issues and defense funding increases.

President Donald Trump met with the “Big Four” congressional leaders — House Speaker Paul Ryan, Senate Majority Leader Mitch McConnell, House Minority Leader Nancy Pelosi and Senate Minority Leader Chuck Schumer — at the White House on Thursday afternoon in an effort to restart negotiations over a two-year budget deal.

“The president had a constructive meeting with congressional leadership and Defense Secretary [Jim] Mattis, and the parties agreed on the need for eliminating the defense sequester to deal with the grave national security threats we face,” the White House press secretary Sarah Huckabee Sanders said in a statement.

Earlier on Thursday, Pelosi, D-Calif., said her caucus would push for more parity in military and non-military spending in a broader budget deal.

“We also need a strong domestic budget,” she said. “In our domestic budget, it includes Homeland Security, anti-terrorism activities of the Justice Department, Veterans Affairs and the State Department … So when they’re saying we’re keeping a lid on the increase on that side, we’re hurting our national security while preaching that we’re raising the cap for defense.”

That has been a non-starter for many conservatives in Congress, who in recent days have floated the idea of boosting defense spending for fiscal 2018 but holding non-military programs at fiscal 2017 levels, amounting to an inflationary cut.

The chairman of the conservative Republican Study Committee, Rep. Mark Walker, said House GOP defense and fiscal hawks had come together to support passage later this month of Pentagon spending bill alone with some disaster-relief money and a continuing resolution with flat funding for the rest of the government.

“[Defense] always has bipartisan support, making sure with everything going on on the Korean Peninsula and other things, I think most people are OK with that,” said Walker, R-N.C., said of the proposal. “That makes it less of a political football. Let’s get that out of the way.”

Conservatives said that in exchange for their votes on the continuing resolution through Dec. 22, Ryan, R-Wis., had pledged to argue the position in budget talks with his Democratic counterparts and the White House.

Still, the idea is unpopular with moderate Republicans, and Ryan declined to embrace it publicly, saying at a press conference earlier Thursday, “I like to keep our family conversations within the family.”

Dent called the proposal “a complete and total fantasy,” arguing that he and a number of Republicans in both chambers disagreed with it, as did Senate Democrats, whose votes are needed to pass a final budget deal.

Beyond spending levels, there is a list of no-go issues for House conservatives that all happen to be priorities for Senate Democrats (and some Republicans). Congressional budgeting brinksmanship could explode over those in the coming weeks.

Among these, House conservatives insist that there be no cost-sharing reduction payments for health insurance, no increase to the national debt limit and no protections for the 700,000 people who are in the U.S. illegally and were brought to the country as children.

Rep. Mark Meadows, chairman of the conservative House Freedom Caucus, pledged “major, major pushback” should an immigration fix be attached to an eventual spending bill.

“I don’t see that,” said Meadows, R-N.C. “The pushback would be too costly.”