Congressional Republicans remained sharply divided Monday over how to fund the Department of Homeland Security, prompting White House officials to begin preparations for a potential shutdown of the agency this weekend.

“Right now, that does seem to be where we’re headed,” White House press secretary Josh Earnest told reporters Monday.

Late Monday, Senate Democrats again filibustered a Republican funding proposal for DHS because the money is tied to a repeal of President Obama’s executive actions on immigration. The House passed the bill in mid-January, and the Senate has been trying unsuccessfully since then to advance the proposal. On Monday the vote was 47 to 46, well short of the 60 votes necessary to overcome the Democrats’ procedural roadblock. The Monday vote marked Republicans’ fourth attempt to move the House bill.

Congress approved a full year’s funding for the rest of the federal government in December, but Republicans held back funding for DHS in reaction to Obama’s immigration actions, giving the agency budget authority only through midnight Feb. 27.

Now, with four days before the security agency’s budget lapses, senior Republicans are pushing for a new strategy that does not directly link Obama’s actions on immigration to funding for DHS. Senate Majority Leader Mitch McConnell (R-Ky.), who had previously acknowledged that the chamber was in stalemate over the issue, set up votes later this week on separate legislation that would repeal one of Obama’s immigration actions.

Those actions, announced in December, would grant temporary relief from deportation to more than 4 million illegal immigrants. McConnell’s hope is that moving the immigration issue onto a separate bill may create a path for the DHS funding bill to go through.

“It’s another way to get the Senate unstuck,” McConnell said.

The standoff has left White House officials preparing for a partial shutdown of the conglomerate domestic security agency, which includes Customs and Border Protection, the Transportation Security Administration, the Secret Service, and the Federal Emergency Management Agency.

In the event of a shutdown, the immediate public impact is likely to be minimal. Most security officers would stay on the job, unpaid, during a shutdown while tens of thousands of administrative staffers would be deemed “non­essential” and furloughed until a funding deal was reached.

Many Senate Republicans seized on last week’s ruling from a federal judge in Texas halting the implementation of Obama’s immigration actions as the way to keep up the fight without shutting down a critical security agency.

“We need to fund the Department of Homeland Security. We cannot shut down the Department of Homeland Security,” Sen. John McCain (R-Ariz.) said Monday evening. He repeated himself for emphasis: “I said we cannot shut down the Department of Homeland Security.”

McCain has called the judicial ruling in Texas “an exit sign” that can keep up the battle without the political consequences of a funding lapse. On Monday, the administration asked U.S. District Judge Andrew S. Hanen to lift his hold on the president’s immigration moves. The government also filed an appeal of Hanen’s decision with the U.S. Court of Appeals for the 5th Circuit in New Orleans.

House Republicans and some Senate Republicans have been unwilling to adopt McCain’s approach and are instead trying to set up Democrats to receive most of the blame. On Monday, all eight Virginia Republicans in the House sent a letter to the state’s two Democratic senators in an effort to help break the Senate filibuster of the GOP-drafted legislation.

“We have reached a moment of constitutional crisis,” the Republicans wrote to Sens. Mark R. Warner and Timothy M. Kaine.

Most congressional Democrats support Obama’s executive actions on immigration, and even those opposed have said that funding DHS is too important to be tied up in the fight over the president’s actions. Democrats also believe that they are on sound political ground and that blame for a shutdown would fall disproportionately on Republicans, as it did during the October 2013 shutdown of the entire federal government.

“It’s one of the dumbest things they can do, and it’s also one of the most dangerous things they can do,” Rep. Steve Israel (D-N.Y.) said in an interview. “They are literally flirting with disaster.”

Sen. Jon Tester (D-Mont.), chairman of the Democratic Senatorial Campaign Committee, said: “I think the political implications are very bad for the people who want to shut the government down.”

Outside conservative groups, including Heritage Action, have been pushing Republicans to not approve a “clean” funding plan, demanding that any DHS budget include the immigration provisions that would reverse Obama’s actions.

House Speaker John A. Boehner (R-Ohio) has sided with Heritage Action and other conservatives, even after the judge’s ruling last week that could tie up the issue for many months in the courts.

“The House has passed a bill to fund the Homeland Security Department, but Senate Democrats are blocking debate on it — and, with just days left before the deadline, President Obama is doing nothing to help,” Michael Steel, Boehner’s spokesman, said Monday in a statement.

Senior Senate Republicans said a DHS shutdown would be a political debacle given the increased violence in the Middle East and new threats of attack against U.S. and European shopping malls.

“We need to figure out a way to get it funded, and my guess is that will occur,” Sen. Bob Corker (R-Tenn.), chairman of the Senate Foreign Relations Committee, said Monday. He suggested that a short-term bill keeping funding at 2014 levels for a couple of months will be approved to allow some of the legal process in Texas to play out.

Another senior senator suggested that the chamber could also hold a nonbinding vote expressing support for the judge’s ruling, so Republicans would be able to express their opposition to Obama’s moves. “One way would be to have a clean DHS funding bill and a resolution that puts the Senate in support of the court’s ruling,” said Sen. Susan Collins (R-Maine), a former chairman of the Senate Committee on Homeland Security and Governmental Affairs.

Sunday on CBS’s “Face the Nation,” McCain said that he is “angry” over the president’s unilateral move but that Republicans are destined to be blamed for a DHS shutdown, potentially undermining their broader standing on the issue.

“I remember last time we shut down the whole government,” McCain said. “This would obviously be Homeland Security. The last time we shut down the whole government, we turned away 600,000 visitors to our national parks here in Arizona. I don’t want to see that movie again.”

Sen. Joe Manchin III (W.Va.), a conservative Democrat, agreed that the judicial fight over Obama’s actions could break the congressional deadlock on DHS funding. Manchin opposes the president’s immigration actions but has said that the security agency’s funding is too important to get tied up to the immigration fight.

“I think our Republican friends are in perfect position right now with the court order,” Manchin said. “And the president said he would back down and wait until the judge rules. That’s a perfect position to be in to get a clean DHS bill.”

Mike DeBonis contributed to this report.